Struct DelegateSpawner

Source
pub struct DelegateSpawner { /* private fields */ }
Expand description

Type used to spawn / spawn_root new delegates onto the Application

Implementations§

Source§

impl DelegateSpawner

Source

pub fn new() -> DelegateSpawner

Source

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.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.