Struct icu_provider::any::AnyResponse
source · pub struct AnyResponse {
pub metadata: DataResponseMetadata,
pub payload: Option<AnyPayload>,
}
Expand description
A DataResponse
for type-erased values.
Convertible to and from DataResponse<AnyMarker>
.
Fields§
§metadata: DataResponseMetadata
Metadata about the returned object.
payload: Option<AnyPayload>
The object itself; None if it was not loaded.
Implementations§
source§impl AnyResponse
impl AnyResponse
sourcepub fn downcast<M>(self) -> Result<DataResponse<M>, DataError>where
M: DataMarker,
for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
M::Yokeable: ZeroFrom<'static, M::Yokeable> + MaybeSendSync,
pub fn downcast<M>(self) -> Result<DataResponse<M>, DataError>where M: DataMarker, for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone, M::Yokeable: ZeroFrom<'static, M::Yokeable> + MaybeSendSync,
Transforms a type-erased AnyResponse
into a concrete DataResponse<M>
.
sourcepub fn downcast_cloned<M>(&self) -> Result<DataResponse<M>, DataError>where
M: DataMarker,
M::Yokeable: ZeroFrom<'static, M::Yokeable> + MaybeSendSync,
for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
pub fn downcast_cloned<M>(&self) -> Result<DataResponse<M>, DataError>where M: DataMarker, M::Yokeable: ZeroFrom<'static, M::Yokeable> + MaybeSendSync, for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
Clones and then transforms a type-erased AnyResponse
into a concrete DataResponse<M>
.
Trait Implementations§
source§impl Debug for AnyResponse
impl Debug for AnyResponse
source§impl From<AnyResponse> for DataResponse<AnyMarker>
impl From<AnyResponse> for DataResponse<AnyMarker>
source§fn from(other: AnyResponse) -> Self
fn from(other: AnyResponse) -> Self
Converts to this type from the input type.