Struct zng_app::AppEventSender
source · pub struct AppEventSender(/* private fields */);
Expand description
A sender that can awake apps and insert events into the main loop.
A Clone of the sender is available in UPDATES.sender
.
Implementations§
source§impl AppEventSender
impl AppEventSender
sourcepub fn send_update(
&self,
op: UpdateOp,
target: impl Into<Option<WidgetId>>,
) -> Result<(), AppDisconnected<()>>
pub fn send_update( &self, op: UpdateOp, target: impl Into<Option<WidgetId>>, ) -> Result<(), AppDisconnected<()>>
Causes an update cycle to happen in the app.
sourcepub fn send_resume_unwind(
&self,
payload: Box<dyn Any + Send + 'static>,
) -> Result<(), AppDisconnected<Box<dyn Any + Send + 'static>>>
pub fn send_resume_unwind( &self, payload: Box<dyn Any + Send + 'static>, ) -> Result<(), AppDisconnected<Box<dyn Any + Send + 'static>>>
Resume a panic in the app main loop thread.
sourcepub fn waker(&self, target: impl Into<Option<WidgetId>>) -> Waker
pub fn waker(&self, target: impl Into<Option<WidgetId>>) -> Waker
Create an Waker
that causes a send_update
.
sourcepub fn ext_channel<T>(&self) -> (AppExtSender<T>, AppExtReceiver<T>)
pub fn ext_channel<T>(&self) -> (AppExtSender<T>, AppExtReceiver<T>)
Create an unbound channel that causes an extension update for each message received.
sourcepub fn ext_channel_bounded<T>(
&self,
cap: usize,
) -> (AppExtSender<T>, AppExtReceiver<T>)
pub fn ext_channel_bounded<T>( &self, cap: usize, ) -> (AppExtSender<T>, AppExtReceiver<T>)
Create a bounded channel that causes an extension update for each message received.
Trait Implementations§
source§impl Clone for AppEventSender
impl Clone for AppEventSender
source§fn clone(&self) -> AppEventSender
fn clone(&self) -> AppEventSender
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for AppEventSender
impl RefUnwindSafe for AppEventSender
impl Send for AppEventSender
impl Sync for AppEventSender
impl Unpin for AppEventSender
impl UnwindSafe for AppEventSender
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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