[−][src]Struct thingvellir::DataLoadRequest
Methods
impl<Key, Data> DataLoadRequest<Key, Data>
[src]
pub fn key(&self) -> &Key
[src]
pub fn resolve(self, data: Data)
[src]
pub fn reject<E: Into<UpstreamError>>(self, error: E)
[src]
impl<Key: Send + 'static, Data: ServiceData> DataLoadRequest<Key, Data>
[src]
pub fn spawn<F: Future<Output = Result<Data, UpstreamError>> + Send + 'static>(
self,
fut: F
)
[src]
self,
fut: F
)
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.
impl<Key: Send + 'static, Data: ServiceData + Default> DataLoadRequest<Key, Data>
[src]
pub fn spawn_default<F: Future<Output = Result<Data, UpstreamError>> + Send + 'static>(
self,
fut: F
)
[src]
self,
fut: F
)
Similar to spawn
, however, in event of encountering a UpstreamError::KeyNotFound
, error
will resolve with the value of Data::default
.
Trait Implementations
impl<Key, Data> Drop for DataLoadRequest<Key, Data>
[src]
Auto Trait Implementations
impl<Key, Data> !RefUnwindSafe for DataLoadRequest<Key, Data>
impl<Key, Data> Send for DataLoadRequest<Key, Data> where
Data: Send,
Key: Send,
Data: Send,
Key: Send,
impl<Key, Data> Sync for DataLoadRequest<Key, Data> where
Data: Send,
Key: Send + Sync,
Data: Send,
Key: Send + Sync,
impl<Key, Data> Unpin for DataLoadRequest<Key, Data> where
Key: Unpin,
Key: Unpin,
impl<Key, Data> !UnwindSafe for DataLoadRequest<Key, Data>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,