pub struct InitContext { /* private fields */ }Expand description
Context handed to init so a plugin can schedule startup background
work before the first block. Concrete (not generic over the task
type) because init’s signature lives on the leaf trait; recover the
typed spawner with Self::tasks. Params arrive as the separate
init argument.
Implementations§
Source§impl InitContext
impl InitContext
pub fn new(tasks: Option<AnyTaskSpawner>) -> InitContext
Sourcepub fn tasks<T>(&self) -> Option<TaskSpawner<T>>where
T: Send + 'static,
pub fn tasks<T>(&self) -> Option<TaskSpawner<T>>where
T: Send + 'static,
The task spawner for task type T, or None if the plugin declared
no tasks: lane of that type on plugin!.
Auto Trait Implementations§
impl !RefUnwindSafe for InitContext
impl !UnwindSafe for InitContext
impl Freeze for InitContext
impl Send for InitContext
impl Sync for InitContext
impl Unpin for InitContext
impl UnsafeUnpin for InitContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more