pub struct Reply {
pub status: u16,
pub body: Vec<u8>,
}Expand description
What the control plane answered: a status and a raw body.
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>Implementations§
Source§impl Reply
impl Reply
Sourcepub fn json<T: DeserializeOwned>(&self, operation: &str) -> Result<T, Error>
pub fn json<T: DeserializeOwned>(&self, operation: &str) -> Result<T, Error>
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.