pub struct FrameRequester { /* private fields */ }Expand description
A requester for scheduling future frame draws on the TUI event loop.
This is the handler side of an actor/handler pair with FrameScheduler, which coalesces
multiple frame requests into a single draw operation.
Clones of this type can be freely shared across tasks to make it possible to trigger frame draws from anywhere in the TUI code.
Implementations§
Source§impl FrameRequester
impl FrameRequester
Sourcepub fn new(draw_tx: Sender<()>) -> Self
pub fn new(draw_tx: Sender<()>) -> Self
Create a new FrameRequester and spawn its associated FrameScheduler task.
The provided draw_tx is used to notify the TUI event loop of scheduled draws.
Sourcepub fn schedule_frame(&self)
pub fn schedule_frame(&self)
Schedule a frame draw as soon as possible.
Sourcepub fn schedule_frame_in(&self, dur: Duration)
pub fn schedule_frame_in(&self, dur: Duration)
Schedule a frame draw to occur after the specified duration.
Trait Implementations§
Source§impl Clone for FrameRequester
impl Clone for FrameRequester
Source§fn clone(&self) -> FrameRequester
fn clone(&self) -> FrameRequester
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 FrameRequester
impl RefUnwindSafe for FrameRequester
impl Send for FrameRequester
impl Sync for FrameRequester
impl Unpin for FrameRequester
impl UnsafeUnpin for FrameRequester
impl UnwindSafe for FrameRequester
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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