pub fn schedule(&mut self) {
        if let Self::New { .. } = self {
            let (tx, rx) = futures::channel::oneshot::channel();

            match std::mem::replace(self, BatchLoad::Pending(rx)) {
                Self::New { load_fn, input, .. } => {
                    with_batch_ctx(|ctx| {
                        let batch = ctx.accumulating.entry(load_fn).or_insert(Batch::empty());

                        batch.push(input, tx);
                    });
                }
                _ => unreachable!(),
            };
        }
    }
/// 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 the future is not polled until later.
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 the future is not polled until later.
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 the future is not polled until later .
pub fn schedule(&mut self) {
        if let Self::New { .. } = self {
            let (tx, rx) = futures::channel::oneshot::channel();
            match std::mem::replace(self, BatchLoad::Pending(rx)) {
                Self::New { load_fn, input, .. } => {
                    with_batch_ctx(|ctx| {
                        let batch = ctx.accumulating.entry(load_fn).or_insert(Batch::empty());
                        batch.push(input, tx);
                    });
                }
                _ => unreachable!(),
            };
        }
    }
pub fn schedule ( & mut self ) { if let Self :: New { .. } = self { let ( tx , rx ) = futures :: channel :: oneshot :: channel ( ) ; match std :: mem :: replace ( self , BatchLoad :: Pending ( rx ) ) { Self :: New { load_fn , input , .. } => { with_batch_ctx ( | ctx | { let batch = ctx . accumulating . entry ( load_fn ) . or_insert ( Batch :: empty ( ) ) ; batch . push ( input , tx ) ; } ) ; } _ => unreachable ! ( ) , } ; } }
Schedules this input to be loaded within the current batch context.
Schedules this input to be loaded within the current batch context .
&mut self
&mut self