pub struct Root<T: Component> { /* private fields */ }Expand description
Helper to run a root component.
Implementations§
Source§impl<T: Component> Root<T>
impl<T: Component> Root<T>
Sourcepub async fn init<'a>(init: impl Into<T::Init<'a>>) -> Result<Self, T::Error>
pub async fn init<'a>(init: impl Into<T::Init<'a>>) -> Result<Self, T::Error>
Create a new root component.
Sourcepub async fn emit(&mut self, message: T::Message) -> Result<bool, T::Error>
pub async fn emit(&mut self, message: T::Message) -> Result<bool, T::Error>
Emit message to the component.
Sourcepub fn sender(&self) -> &ComponentSender<T>
pub fn sender(&self) -> &ComponentSender<T>
Get the sender of the component.
Sourcepub fn into_child(self) -> Child<T>
pub fn into_child(self) -> Child<T>
Convert the root component into a child component.
Auto Trait Implementations§
impl<T> Freeze for Root<T>where
T: Freeze,
impl<T> RefUnwindSafe for Root<T>where
T: RefUnwindSafe,
impl<T> Send for Root<T>
impl<T> Sync for Root<T>
impl<T> Unpin for Root<T>where
T: Unpin,
impl<T> UnsafeUnpin for Root<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Root<T>where
T: UnwindSafe,
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