pub struct Reply {
pub status: u16,
pub body: Vec<u8>,
pub error_type: Option<String>,
}Expand description
What the control plane answered: a status, a raw body, and the error type the service named, if it named one.
Raw bytes rather than a deserialized value because the error path has to read a body
the success types cannot hold, and because TRAP-6’s null message field is only
visible to something that did not already require a String there.
Fields§
§status: u16§body: Vec<u8>§error_type: Option<String>The x-amzn-ErrorType header’s error name, cut down by error_type_name, or
None when the response carried no such header. classify_failure reads it
before the status, because the service has sent a throttle as HTTP 400.
Implementations§
Source§impl Reply
impl Reply
Sourcepub fn json<T>(&self, operation: &str) -> Result<T, Error>where
T: DeserializeOwned,
pub fn json<T>(&self, operation: &str) -> Result<T, Error>where
T: DeserializeOwned,
Deserializes the body as T, or reports the failure with the body attached.
The body goes in the message because a rest-json parse failure with the text withheld is unactionable: the reader cannot tell a renamed member from a truncated response. Truncated to 512 bytes, since a list response can be large and the first 512 characters always contain the member that failed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Reply
impl RefUnwindSafe for Reply
impl Send for Reply
impl Sync for Reply
impl Unpin for Reply
impl UnsafeUnpin for Reply
impl UnwindSafe for Reply
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more