pub struct DelegateSpawner { /* private fields */ }
Expand description
Type used to spawn / spawn_root new delegates onto the Application
Implementations§
Source§impl DelegateSpawner
impl DelegateSpawner
pub fn new() -> DelegateSpawner
Sourcepub fn spawn<D>(&mut self, spawnable_delegate: D) -> SpawnHandle<D::Handle>where
D: 'static + SpawnableDelegate,
pub fn spawn<D>(&mut self, spawnable_delegate: D) -> SpawnHandle<D::Handle>where
D: 'static + SpawnableDelegate,
Takes ownership of a Delegate, returns a SpawnHandle containing the Handle type of the SpawnableDelegate
The spawned object cannot be found by the object spawning it, therefore it should use the Handle returned to get information
Dropping all instances of the SpawnHandle will cause the delegate to be dropped.
Sourcepub fn spawn_root<D: 'static + Delegate>(&mut self, delegate: D)
pub fn spawn_root<D: 'static + Delegate>(&mut self, delegate: D)
Takes ownership of a Delegate, it is held for the lifetime of the entire Application
Auto Trait Implementations§
impl Freeze for DelegateSpawner
impl !RefUnwindSafe for DelegateSpawner
impl !Send for DelegateSpawner
impl !Sync for DelegateSpawner
impl Unpin for DelegateSpawner
impl !UnwindSafe for DelegateSpawner
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