Struct rat_salsa::RenderContext
source · pub struct RenderContext<'a, Global> {
pub g: &'a mut Global,
pub timeout: Option<TimeOut>,
pub count: usize,
pub cursor: Option<(u16, u16)>,
/* private fields */
}Expand description
A collection of context data used for rendering.
Fields§
§g: &'a mut GlobalSome global state for the application.
timeout: Option<TimeOut>Current timeout that triggered the repaint.
count: usizeFrame counter.
cursor: Option<(u16, u16)>Output cursor position. Set after rendering is complete.
Implementations§
source§impl<'a, Global> RenderContext<'a, Global>
impl<'a, Global> RenderContext<'a, Global>
sourcepub fn add_timer(&self, t: TimerDef) -> TimerHandle
pub fn add_timer(&self, t: TimerDef) -> TimerHandle
Add a timer.
sourcepub fn remove_timer(&self, tag: TimerHandle)
pub fn remove_timer(&self, tag: TimerHandle)
Remove a timer.
sourcepub fn replace_timer(&self, h: Option<TimerHandle>, t: TimerDef) -> TimerHandle
pub fn replace_timer(&self, h: Option<TimerHandle>, t: TimerDef) -> TimerHandle
Replace a timer.
sourcepub fn set_screen_cursor(&mut self, cursor: Option<(u16, u16)>)
pub fn set_screen_cursor(&mut self, cursor: Option<(u16, u16)>)
Set the cursor, if the given value is Some.
Trait Implementations§
Auto Trait Implementations§
impl<'a, Global> Freeze for RenderContext<'a, Global>
impl<'a, Global> !RefUnwindSafe for RenderContext<'a, Global>
impl<'a, Global> !Send for RenderContext<'a, Global>
impl<'a, Global> !Sync for RenderContext<'a, Global>
impl<'a, Global> Unpin for RenderContext<'a, Global>
impl<'a, Global> !UnwindSafe for RenderContext<'a, Global>
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> 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