Struct distant_net::common::Response
source · pub struct Response<T> {
pub id: Id,
pub origin_id: Id,
pub payload: T,
}Expand description
Represents a response received related to some response
Fields§
§id: IdUnique id associated with the response
origin_id: IdUnique id associated with the response that triggered the response
payload: TPayload associated with the response
Implementations§
source§impl<T> Response<T>where
T: Serialize,
impl<T> Response<T>where T: Serialize,
sourcepub fn to_payload_vec(&self) -> Result<Vec<u8>>
pub fn to_payload_vec(&self) -> Result<Vec<u8>>
Serializes the response’s payload into bytes
sourcepub fn to_untyped_response(&self) -> Result<UntypedResponse<'_>>
pub fn to_untyped_response(&self) -> Result<UntypedResponse<'_>>
Attempts to convert a typed response to an untyped response
source§impl<T> Response<T>where
T: DeserializeOwned,
impl<T> Response<T>where T: DeserializeOwned,
sourcepub fn from_slice(slice: &[u8]) -> Result<Self>
pub fn from_slice(slice: &[u8]) -> Result<Self>
Deserializes the response from bytes
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for Response<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Response<T>where T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq> PartialEq<Response<T>> for Response<T>
impl<T: PartialEq> PartialEq<Response<T>> for Response<T>
impl<T: Eq> Eq for Response<T>
impl<T> StructuralEq for Response<T>
impl<T> StructuralPartialEq for Response<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Response<T>where T: RefUnwindSafe,
impl<T> Send for Response<T>where T: Send,
impl<T> Sync for Response<T>where T: Sync,
impl<T> Unpin for Response<T>where T: Unpin,
impl<T> UnwindSafe for Response<T>where T: UnwindSafe,
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