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
Rejects the data load request with a given error. The error must be able to
be converted into an UpstreamError.
pub fn spawn_default<F: Future<Output = Result<Data, UpstreamError>> + Send + 'static>(
self,
fut: F
)
pub fn spawn_default<F: Future<Output = Result<Data, UpstreamError>> + Send + 'static>(
self,
fut: F
)
Similar to spawn, however, in event of encountering a UpstreamError::KeyNotFound, error
will resolve with the value of Data::default.