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
Takes ownership of the underlying payload. Error if not present.
To take the metadata, too, use Self::take_metadata_and_payload()
.
pub 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
impl<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,
impl<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,
Performs the conversion.
Auto Trait Implementations
impl<M> RefUnwindSafe for DataResponse<M> where
<M as DataMarker>::Yokeable: RefUnwindSafe,
impl<M> !Send for DataResponse<M>
impl<M> !Sync for DataResponse<M>
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
Mutably borrows from an owned value. Read more
fn filterable(
self,
filter_name: &'static str
) -> RequestFilterDataProvider<Self, fn(_: &DataRequest) -> bool>
fn filterable(
self,
filter_name: &'static str
) -> RequestFilterDataProvider<Self, fn(_: &DataRequest) -> bool>
Creates a filterable data provider with the given name for debugging. Read more