#[non_exhaustive]
pub struct ContinuationEvent {}
Expand description

Implementations§

Creates a new builder-style object to manufacture ContinuationEvent.

Examples found in repository?
src/event_stream_serde.rs (line 78)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
    fn unmarshall(
        &self,
        message: &aws_smithy_eventstream::frame::Message,
    ) -> std::result::Result<
        aws_smithy_eventstream::frame::UnmarshalledMessage<Self::Output, Self::Error>,
        aws_smithy_eventstream::error::Error,
    > {
        let response_headers = aws_smithy_eventstream::smithy::parse_response_headers(message)?;
        match response_headers.message_type.as_str() {
            "event" => match response_headers.smithy_type.as_str() {
                "Records" => {
                    let mut builder = crate::model::records_event::Builder::default();
                    let content_type = response_headers.content_type().unwrap_or_default();
                    if content_type != "application/octet-stream" {
                        return Err(aws_smithy_eventstream::error::Error::unmarshalling(format!(
                                                "expected :content-type to be 'application/octet-stream', but was '{}'",
                                                content_type
                                            )));
                    }
                    builder = builder.set_payload(Some(aws_smithy_types::Blob::new(
                        message.payload().as_ref(),
                    )));
                    Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                        crate::model::SelectObjectContentEventStream::Records(builder.build()),
                    ))
                }
                "Stats" => {
                    let mut builder = crate::model::stats_event::Builder::default();
                    builder = builder.set_details(Some(
                        crate::xml_deser::deser_member_com_amazonaws_s3_stats_event_details(
                            &message.payload()[..],
                        )
                        .map_err(|err| {
                            aws_smithy_eventstream::error::Error::unmarshalling(format!(
                                "failed to unmarshall details: {}",
                                err
                            ))
                        })?,
                    ));
                    Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                        crate::model::SelectObjectContentEventStream::Stats(builder.build()),
                    ))
                }
                "Progress" => {
                    let mut builder = crate::model::progress_event::Builder::default();
                    builder = builder.set_details(Some(
                        crate::xml_deser::deser_member_com_amazonaws_s3_progress_event_details(
                            &message.payload()[..],
                        )
                        .map_err(|err| {
                            aws_smithy_eventstream::error::Error::unmarshalling(format!(
                                "failed to unmarshall details: {}",
                                err
                            ))
                        })?,
                    ));
                    Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                        crate::model::SelectObjectContentEventStream::Progress(builder.build()),
                    ))
                }
                "Cont" => Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                    crate::model::SelectObjectContentEventStream::Cont(
                        crate::model::ContinuationEvent::builder().build(),
                    ),
                )),
                "End" => Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                    crate::model::SelectObjectContentEventStream::End(
                        crate::model::EndEvent::builder().build(),
                    ),
                )),
                _unknown_variant => Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Event(
                    crate::model::SelectObjectContentEventStream::Unknown,
                )),
            },
            "exception" => {
                let generic =
                    match crate::xml_deser::parse_event_stream_generic_error(message.payload()) {
                        Ok(generic) => generic,
                        Err(err) => {
                            return Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
                                crate::error::SelectObjectContentEventStreamError::unhandled(err),
                            ))
                        }
                    };
                Ok(aws_smithy_eventstream::frame::UnmarshalledMessage::Error(
                    crate::error::SelectObjectContentEventStreamError::generic(generic),
                ))
            }
            value => {
                return Err(aws_smithy_eventstream::error::Error::unmarshalling(
                    format!("unrecognized :message-type: {}", value),
                ));
            }
        }
    }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more