diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 7b44b6203d..4cc8c88295 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -640,3 +640,9 @@ message = "The implementation `From` fo references = ["smithy-rs#2845"] meta = { "breaking" = true, "tada" = false, "bug" = false } author = "ysaito1001" + +[[smithy-rs]] +message = "The implementation `From` for `aws_smithy_http::event_stream::RawMessage` has been removed." +references = ["smithy-rs#2848"] +meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" } +author = "ysaito1001" diff --git a/rust-runtime/aws-smithy-http/external-types.toml b/rust-runtime/aws-smithy-http/external-types.toml index b06231e92f..a228978c9a 100644 --- a/rust-runtime/aws-smithy-http/external-types.toml +++ b/rust-runtime/aws-smithy-http/external-types.toml @@ -31,7 +31,4 @@ allowed_external_types = [ # TODO(https://github.com/awslabs/smithy-rs/issues/1193): Once tooling permits it, only allow the following types in the `event-stream` feature "aws_smithy_eventstream::*", - - # TODO(https://github.com/awslabs/smithy-rs/issues/1193): Decide whether to expose this type or not - "bytes_utils::segmented::SegmentedBuf", ] diff --git a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs index aa7f914223..3b38161f3b 100644 --- a/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs +++ b/rust-runtime/aws-smithy-http/src/event_stream/receiver.rs @@ -97,8 +97,8 @@ pub enum RawMessage { Invalid(Option), } -impl From<&mut SegmentedBuf> for RawMessage { - fn from(buf: &mut SegmentedBuf) -> Self { +impl RawMessage { + pub(crate) fn invalid(buf: &mut SegmentedBuf) -> Self { Self::Invalid(Some(buf.copy_to_bytes(buf.remaining()))) } } @@ -213,7 +213,7 @@ impl Receiver { ReceiverError { kind: ReceiverErrorKind::UnexpectedEndOfStream, }, - self.buffer.buffered().into(), + RawMessage::invalid(self.buffer.buffered()), )); } Ok(None)