pub struct Root<T>where
T: Component,{ /* private fields */ }Available on crate feature
winio only.Expand description
Helper to run a root component.
Implementations§
Source§impl<T> Root<T>where
T: Component,
impl<T> Root<T>where
T: Component,
Sourcepub async fn init<'a>(
init: impl Into<<T as Component>::Init<'a>>,
) -> Result<Root<T>, <T as Component>::Error>
pub async fn init<'a>( init: impl Into<<T as Component>::Init<'a>>, ) -> Result<Root<T>, <T as Component>::Error>
Create a new root component.
Sourcepub async fn emit(
&mut self,
message: <T as Component>::Message,
) -> Result<bool, <T as Component>::Error>
pub async fn emit( &mut self, message: <T as Component>::Message, ) -> Result<bool, <T as Component>::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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more