Struct icu_provider::prelude::DataResponse
source · [−]pub struct DataResponse<M> where
M: DataMarker, {
pub metadata: DataResponseMetadata,
pub payload: Option<DataPayload<M>>,
}
Expand description
A response object containing an object as payload and metadata about it.
Fields
metadata: DataResponseMetadata
Metadata about the returned object.
payload: Option<DataPayload<M>>
The object itself; None if it was not loaded.
Implementations
sourceimpl<M> DataResponse<M> where
M: DataMarker,
impl<M> DataResponse<M> where
M: DataMarker,
sourcepub fn take_payload(self) -> Result<DataPayload<M>, DataError>
pub fn take_payload(self) -> Result<DataPayload<M>, DataError>
Takes ownership of the underlying payload. Error if not present.
To take the metadata, too, use Self::take_metadata_and_payload()
.
sourcepub fn take_metadata_and_payload(
self
) -> Result<(DataResponseMetadata, DataPayload<M>), DataError>
pub fn take_metadata_and_payload(
self
) -> Result<(DataResponseMetadata, DataPayload<M>), DataError>
Takes ownership of the underlying metadata and payload. Error if payload is not present.
Trait Implementations
sourceimpl<M> Clone for DataResponse<M> where
M: DataMarker,
for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
impl<M> Clone for DataResponse<M> where
M: DataMarker,
for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
sourceimpl<M> Debug for DataResponse<M> where
M: DataMarker,
for<'a> &'a <M::Yokeable as Yokeable<'a>>::Output: Debug,
impl<M> Debug for DataResponse<M> where
M: DataMarker,
for<'a> &'a <M::Yokeable as Yokeable<'a>>::Output: Debug,
sourceimpl From<AnyResponse> for DataResponse<AnyMarker>
impl From<AnyResponse> for DataResponse<AnyMarker>
sourcefn from(other: AnyResponse) -> Self
fn from(other: AnyResponse) -> Self
Converts to this type from the input type.
sourceimpl TryFrom<DataResponse<AnyMarker>> for AnyResponse
impl TryFrom<DataResponse<AnyMarker>> for AnyResponse
sourceimpl<M> TryFrom<DataResponse<M>> for DataPayload<M> where
M: DataMarker,
impl<M> TryFrom<DataResponse<M>> for DataPayload<M> where
M: DataMarker,
Auto Trait Implementations
impl<M> RefUnwindSafe for DataResponse<M> where
<M as DataMarker>::Yokeable: RefUnwindSafe,
impl<M> Send for DataResponse<M> where
<M as DataMarker>::Yokeable: Send,
impl<M> Sync for DataResponse<M> where
<M as DataMarker>::Yokeable: Sync,
impl<M> Unpin for DataResponse<M> where
<M as DataMarker>::Yokeable: Unpin,
impl<M> UnwindSafe for DataResponse<M> where
<M as DataMarker>::Yokeable: UnwindSafe,
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