Enum async_dataloader::BatchLoad[][src]

pub enum BatchLoad<Input, Output: ?Sized> {
    New {
        load_fn: fn(_: Batch) -> Pin<Box<dyn Future<Output = ()>>>,
        input: Box<Input>,
        phantom: PhantomData<Box<Output>>,
    },
    Pending(Receiver<Box<dyn Any>>),
}

Future returned by a batch loader

Variants

New

Fields of New

load_fn: fn(_: Batch) -> Pin<Box<dyn Future<Output = ()>>>input: Box<Input>phantom: PhantomData<Box<Output>>
Pending(Receiver<Box<dyn Any>>)

Implementations

impl<Input: 'static, Output: ?Sized> BatchLoad<Input, Output>[src]

pub fn schedule(&mut self)[src]

Schedules this input to be loaded within the current batch context.

Rust futures are lazy, meaning they have do nothing until polled. Calling this method will cause the load to be added to the next batch, even if it the future is not polled until later.

Trait Implementations

impl<Input: 'static, Output: 'static> Future for BatchLoad<Input, Output>[src]

type Output = Box<Output>

The type of value produced on completion.

Auto Trait Implementations

impl<Input, Output> !RefUnwindSafe for BatchLoad<Input, Output>

impl<Input, Output> !Send for BatchLoad<Input, Output>

impl<Input, Output> !Sync for BatchLoad<Input, Output>

impl<Input, Output: ?Sized> Unpin for BatchLoad<Input, Output>

impl<Input, Output> !UnwindSafe for BatchLoad<Input, Output>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> FutureExt for T where
    T: Future + ?Sized

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Output = <F as Future>::Output

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

The output that the future will produce on completion.

type Future = F

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

Which kind of future are we turning this into?

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.