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.
Auto Trait Implementations§
impl Freeze for AnyResponse
impl !RefUnwindSafe for AnyResponse
impl !Send for AnyResponse
impl !Sync for AnyResponse
impl Unpin for AnyResponse
impl !UnwindSafe for AnyResponse
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