pub struct HighlightPolicy { /* private fields */ }Expand description
How long a change stays highlighted, in how many steps it fades, and how long a removed row fades out.
This is the default implementation of the HighlightPolicy seam.
Implementations§
Source§impl HighlightPolicy
impl HighlightPolicy
Sourcepub fn new(duration: Duration, steps: u32) -> Self
pub fn new(duration: Duration, steps: u32) -> Self
A highlight that lasts duration and fades in steps steps. Removed
rows go at once.
Sourcepub fn with_removal_fade(self, fade: Duration) -> Self
pub fn with_removal_fade(self, fade: Duration) -> Self
Keeps a removed row on screen, fading, for fade, on the global tick
and steps of this policy. Duration::ZERO, the default, removes at
once. A store setting, like the duration: the store keeps the row in
its snapshots while it fades (StoreSnapshot::fading_row).
Sourcepub fn removal_fade(&self) -> Duration
pub fn removal_fade(&self) -> Duration
How long a removed row fades out; zero when it goes at once.
Sourcepub fn duration_ms(&self) -> u32
pub fn duration_ms(&self) -> u32
The highlight duration in milliseconds.
Sourcepub fn tick(&self, now_ms: u32) -> u32
pub fn tick(&self, now_ms: u32) -> u32
The global tick at or before now_ms. All cells are evaluated at the
same tick, so they change steps on the same frames.
Sourcepub fn next_tick(&self, now_ms: u32) -> u32
pub fn next_tick(&self, now_ms: u32) -> u32
The next global tick after now_ms: the single deadline the view
waits for while any visible cell is hot.
Sourcepub fn intensity(&self, stamp: Stamp, tick_ms: u32) -> Option<f32>
pub fn intensity(&self, stamp: Stamp, tick_ms: u32) -> Option<f32>
Highlight intensity at tick_ms, from 1.0 (just changed) down to
1 / steps; None once the highlight expired.
Sourcepub fn is_expired(&self, stamp: Stamp, now_ms: u32) -> bool
pub fn is_expired(&self, stamp: Stamp, now_ms: u32) -> bool
Returns true if the stamp no longer highlights at now_ms.
Sourcepub fn removal_intensity(&self, removed: Stamp, tick_ms: u32) -> Option<f32>
pub fn removal_intensity(&self, removed: Stamp, tick_ms: u32) -> Option<f32>
The intensity of a fading row with the removal stamp removed at
tick_ms: from 1.0 (just removed) down in the steps of the global
tick that fit in Self::removal_fade; None once the fade ended,
and always without a removal fade.
Trait Implementations§
Source§impl Clone for HighlightPolicy
impl Clone for HighlightPolicy
Source§fn clone(&self) -> HighlightPolicy
fn clone(&self) -> HighlightPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HighlightPolicy
impl Debug for HighlightPolicy
Source§impl Default for HighlightPolicy
impl Default for HighlightPolicy
Source§impl PartialEq for HighlightPolicy
impl PartialEq for HighlightPolicy
impl Copy for HighlightPolicy
impl Eq for HighlightPolicy
impl StructuralPartialEq for HighlightPolicy
Auto Trait Implementations§
impl Freeze for HighlightPolicy
impl RefUnwindSafe for HighlightPolicy
impl Send for HighlightPolicy
impl Sync for HighlightPolicy
impl Unpin for HighlightPolicy
impl UnsafeUnpin for HighlightPolicy
impl UnwindSafe for HighlightPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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>
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>
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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().