Struct thingvellir::DataLoadRequest[][src]

pub struct DataLoadRequest<Key, Data> { /* fields omitted */ }
Expand description

The data load request is passed to [LoadFromUpstream::load] handler.

It contains methods to notify the shard that the data has finished loading, or has failed to load.

If the DataLoadRequest is dropped, without sending a result, the shard will receive an UpstreamError::OperationAborted for the given key being loaded. This prevents leaking load requests due to code error, where a code-path did not use the data load request.

Implementations

Returns a reference to the key that is currently being loaded.

Resolves the data load request with the given data.

Rejects the data load request with a given error. The error must be able to be converted into an UpstreamError.

Convenience method to spawn a task to drive a future to completion, and capture that future’s result in order to reject or resolve the data load request.

Similar to spawn, however, in event of encountering a UpstreamError::KeyNotFound, error will resolve with the value of Data::default.

Trait Implementations

Executes the destructor for this type. Read more

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

Performs the conversion.

Performs the conversion.

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.