Struct distant_core::data::Response
source · [−]pub struct Response {
pub tenant: String,
pub id: usize,
pub origin_id: usize,
pub payload: Vec<ResponseData>,
}Expand description
Represents an response to a request performed on the remote machine
Fields
tenant: StringA name tied to the requester (tenant)
id: usizeA unique id associated with the response
origin_id: usizeThe id of the originating request that yielded this response (more than one response may have same origin)
payload: Vec<ResponseData>The main payload containing a collection of data comprising one or more results
Implementations
sourceimpl Response
impl Response
sourcepub fn new(
tenant: impl Into<String>,
origin_id: usize,
payload: Vec<ResponseData>
) -> Self
pub fn new(
tenant: impl Into<String>,
origin_id: usize,
payload: Vec<ResponseData>
) -> Self
Creates a new response, generating a unique id for it
sourcepub fn to_payload_type_string(&self) -> String
pub fn to_payload_type_string(&self) -> String
Converts to a string representing the type (or types) contained in the payload
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Response
impl<'de> Deserialize<'de> for Response
sourcefn 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
impl Eq for Response
impl StructuralEq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more