pub enum SuccessOrError {
Success(Box<SuccessResponse>),
Error(Box<ErrorResponse>),
}Expand description
A success or error response enum
This is used like oneOf in Protobuf so only one of them will be available.
Variants§
Success(Box<SuccessResponse>)
A Box-ed SuccessResponse
Depending on the API request, only some of them would be available to be used.
Error(Box<ErrorResponse>)
A Box-ed ErrorResponse
Implementations§
Source§impl SuccessOrError
impl SuccessOrError
Sourcepub fn merge(
field: &mut Option<SuccessOrError>,
tag: u32,
wire_type: WireType,
buf: &mut impl Buf,
ctx: DecodeContext,
) -> Result<(), DecodeError>
pub fn merge( field: &mut Option<SuccessOrError>, tag: u32, wire_type: WireType, buf: &mut impl Buf, ctx: DecodeContext, ) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into self.
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Trait Implementations§
Source§impl Clone for SuccessOrError
impl Clone for SuccessOrError
Source§fn clone(&self) -> SuccessOrError
fn clone(&self) -> SuccessOrError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SuccessOrError
impl Debug for SuccessOrError
Source§impl PartialEq for SuccessOrError
impl PartialEq for SuccessOrError
impl StructuralPartialEq for SuccessOrError
Auto Trait Implementations§
impl Freeze for SuccessOrError
impl RefUnwindSafe for SuccessOrError
impl Send for SuccessOrError
impl Sync for SuccessOrError
impl Unpin for SuccessOrError
impl UnwindSafe for SuccessOrError
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