pub struct CallResponse(/* private fields */);
Expand description
Tuple, returned from call
and eval
requests.
Implementations§
Source§impl CallResponse
impl CallResponse
Sourcepub fn decode_first<T>(self) -> Result<T, DecodingError>where
T: DeserializeOwned,
pub fn decode_first<T>(self) -> Result<T, DecodingError>where
T: DeserializeOwned,
Decode first element of the tuple, dropping everything else.
This is useful if function doesn’t return an error.
Sourcepub fn decode_two<T1, T2>(self) -> Result<(T1, T2), DecodingError>where
T1: DeserializeOwned,
T2: DeserializeOwned,
pub fn decode_two<T1, T2>(self) -> Result<(T1, T2), DecodingError>where
T1: DeserializeOwned,
T2: DeserializeOwned,
Decode first 2 elements of the tuple, dropping everything else.
Sourcepub fn decode_result<T>(self) -> Result<T, Error>where
T: DeserializeOwned,
pub fn decode_result<T>(self) -> Result<T, Error>where
T: DeserializeOwned,
Decode first two elements of the tuple into result, where
either first element deserialized into T
and returned as Ok(T)
or second element returned as Err(Error::CallEval)
.
If second element is nil
or not present, first element will be returned,
otherwise second element will be returned as error.
Sourcepub fn decode_full<T>(self) -> Result<T, DecodingError>where
T: DeserializeOwned,
pub fn decode_full<T>(self) -> Result<T, DecodingError>where
T: DeserializeOwned,
Decode entire response into type.
Note that currently every response would be a tuple, so be careful what type you are specifying.
Trait Implementations§
Source§impl Clone for CallResponse
impl Clone for CallResponse
Source§fn clone(&self) -> CallResponse
fn clone(&self) -> CallResponse
Returns a copy 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 CallResponse
impl Debug for CallResponse
Source§impl PartialEq for CallResponse
impl PartialEq for CallResponse
impl StructuralPartialEq for CallResponse
Auto Trait Implementations§
impl Freeze for CallResponse
impl RefUnwindSafe for CallResponse
impl Send for CallResponse
impl Sync for CallResponse
impl Unpin for CallResponse
impl UnwindSafe for CallResponse
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