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().

Takes ownership of the underlying metadata and payload. Error if payload is not present.

Trait Implementations

Cloning a DataResponse is generally a cheap operation. See notes in the Clone impl for Yoke.

Examples

use icu_provider::prelude::*;
use icu_provider::hello_world::*;

let resp1: DataResponse<HelloWorldV1Marker> = todo!();
let resp2 = resp1.clone();

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.