Struct HintLayer
pub struct HintLayer<S>where
S: 'static,{ /* private fields */ }Expand description
A host’s set of control hints, scheduled and drawn.
Implementations§
§impl<S> HintLayer<S>
impl<S> HintLayer<S>
pub fn new(specs: &'static [HintSpec<S>], learned: Learned) -> HintLayer<S>
pub fn coach(&self) -> &Coach<S>
pub fn coach_mut(&mut self) -> &mut Coach<S>
pub fn update(
&mut self,
now: Instant,
holds: &dyn Fn(S) -> bool,
quiet: Option<Quiet>,
place: &dyn Fn(&HintSpec<S>) -> Option<HintPlace>,
motion: EffectiveMotion,
)
pub fn update( &mut self, now: Instant, holds: &dyn Fn(S) -> bool, quiet: Option<Quiet>, place: &dyn Fn(&HintSpec<S>) -> Option<HintPlace>, motion: EffectiveMotion, )
Advance to now: holds and quiet as Coach::tick takes them,
place how each hint would show now (None where its anchor is not
on screen).
pub fn needs_frame(&self, now: Instant, motion: EffectiveMotion) -> bool
pub fn needs_frame(&self, now: Instant, motion: EffectiveMotion) -> bool
Whether the hint on screen moves at now.
pub fn next_wake(
&self,
now: Instant,
motion: EffectiveMotion,
) -> Option<Instant>
pub fn next_wake( &self, now: Instant, motion: EffectiveMotion, ) -> Option<Instant>
When the layer next needs a frame: soon while a hint moves, at the schedule’s next change otherwise.
pub fn painted_rect(&self) -> Option<Rect>
pub fn painted_rect(&self) -> Option<Rect>
Everything the last draw painted (the card with its shadow, a lit edge, the dot it folds into and where that lands): while the hint moves, the only pixels it changes are under this and the last draw’s.
pub fn access_node(&self) -> Option<AccessNode>
pub fn access_node(&self) -> Option<AccessNode>
The hint for assistive technology: its words and keys, said politely when it comes.
Auto Trait Implementations§
impl<S> Freeze for HintLayer<S>
impl<S> RefUnwindSafe for HintLayer<S>where
S: RefUnwindSafe,
impl<S> Send for HintLayer<S>where
S: Sync,
impl<S> Sync for HintLayer<S>where
S: Sync,
impl<S> Unpin for HintLayer<S>
impl<S> UnsafeUnpin for HintLayer<S>
impl<S> UnwindSafe for HintLayer<S>where
S: RefUnwindSafe,
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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