[−][src]Struct zi::ComponentLink
A context for sending messages to a component or the runtime.
It can be used in a multi-threaded environment (implements Sync and
Send). Additionally, it can send messages to the runtime, in particular
it's used to gracefully stop a running App.
Implementations
impl<ComponentT: Component> ComponentLink<ComponentT>[src]
pub fn send(&self, message: ComponentT::Message)[src]
Sends a message to the component.
pub fn callback<InputT>(
&self,
callback: impl Fn(InputT) -> ComponentT::Message + 'static
) -> Callback<InputT>[src]
&self,
callback: impl Fn(InputT) -> ComponentT::Message + 'static
) -> Callback<InputT>
Creates a Callback which will send a message to the linked component's
update method when invoked.
pub fn exit(&self)[src]
Sends a message to the App runtime requesting it to stop executing.
This method only sends a message and returns immediately, the app will stop asynchronously and may deliver other pending messages before exiting.
pub fn run_exclusive(
&self,
process: impl FnOnce() -> Option<ComponentT::Message> + Send + 'static
)[src]
&self,
process: impl FnOnce() -> Option<ComponentT::Message> + Send + 'static
)
Runs a closure that requires exclusive access to the backend (i.e. typically to stdin / stdout). For example spawning an external editor to collect some text.
Trait Implementations
impl<ComponentT> Clone for ComponentLink<ComponentT>[src]
fn clone(&self) -> Self[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<ComponentT: Debug> Debug for ComponentLink<ComponentT>[src]
Auto Trait Implementations
impl<ComponentT> !RefUnwindSafe for ComponentLink<ComponentT>
impl<ComponentT> Send for ComponentLink<ComponentT>
impl<ComponentT> Sync for ComponentLink<ComponentT>
impl<ComponentT> Unpin for ComponentLink<ComponentT>
impl<ComponentT> !UnwindSafe for ComponentLink<ComponentT>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,