-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Message
, Header
, HeaderValue
, and StrBytes
from aws-smithy-eventstream
to aws-smithy-types
#3139
Conversation
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
...lin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt
Show resolved
Hide resolved
...lin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt
Show resolved
Hide resolved
...lin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt
Show resolved
Hide resolved
rust-runtime/aws-smithy-eventstream/fuzz/fuzz_targets/round_trip.rs
Outdated
Show resolved
Hide resolved
pub(crate) const TYPE_STRING: u8 = 7; | ||
pub(crate) const TYPE_TIMESTAMP: u8 = 8; | ||
pub(crate) const TYPE_UUID: u8 = 9; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a general question, so we do not allow a float / double as a type in HeaderValue? I guess, they can always be passed as a String.
...lin/software/amazon/smithy/rust/codegen/core/smithy/customizations/SmithyTypesPubUseExtra.kt
Show resolved
Hide resolved
This commit addresses #3139 (comment) #3139 (comment)
A new generated diff is ready to view.
A new doc preview is ready to view. |
A new generated diff is ready to view.
A new doc preview is ready to view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Motivation and Context
Fixes the following statement in #3114
so that the
recv
method on a new-type wrapperaws_smithy_http::event_stream::Receiver
can exposeSdkError<E, RawMessage>>
in public API. It is the responsibility of the above PR to move RawMessage fromaws-smithy-http
toaws-smithy-types
but doing so first requiresMessage
to be moved toaws-smithy-types
, hence this PR.Description
Moving
Message
toaws-smithy-types
also requires moving the types it depends upon, namelyHeader
,HederValue
, andStrBytes
. However, their serialization/deserialization methods (read_from
andwrite_to
) remain inaws-smithy-eventstream
and they are converted to free functions, with the aim of moving things as minimally as possible.aws-smithy-eventstream
has fuzz testing. It previously implemented theArbitrary
trait for moved types, but since they are now inaws-smithy-types
, we need to have newtypes for them to enable the trait due to the orphan rules. A newly added moduleaws-smithy-eventstream::arbitrary
is exactly for that purpose.Testing
Relied on the existing tests.
Checklist
CHANGELOG.next.toml
if I made changes to the smithy-rs codegen or runtime cratesBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.