Struct CursorChats
pub struct CursorChats { /* private fields */ }Expand description
Everyone’s cursor chat and reactions in one presence store.
Implementations§
§impl CursorChats
impl CursorChats
pub fn say(
&mut self,
user: &UserId,
said: Option<(&str, bool)>,
now: Instant,
) -> bool
pub fn say( &mut self, user: &UserId, said: Option<(&str, bool)>, now: Instant, ) -> bool
user says text beside their pointer (sent once they pressed
Enter), or stops saying anything with None. Returns whether what is
shown changed.
pub fn react(
&mut self,
user: &UserId,
seq: u32,
emoji: &str,
now: Instant,
) -> bool
pub fn react( &mut self, user: &UserId, seq: u32, emoji: &str, now: Instant, ) -> bool
user reacted with emoji, their seqth reaction. Plays once per
new counter; returns whether it started.
pub fn forget(&mut self, user: &UserId) -> bool
pub fn forget(&mut self, user: &UserId) -> bool
Forget everything user said and reacted: they left, or are no
longer shown to this person.
pub fn bubble(
&self,
user: &UserId,
now: Instant,
motion: EffectiveMotion,
) -> Option<ChatBubble>
pub fn bubble( &self, user: &UserId, now: Instant, motion: EffectiveMotion, ) -> Option<ChatBubble>
The bubble to draw beside user’s pointer at now.
pub fn reaction(
&self,
user: &UserId,
now: Instant,
motion: EffectiveMotion,
) -> Option<ReactionFloat>
pub fn reaction( &self, user: &UserId, now: Instant, motion: EffectiveMotion, ) -> Option<ReactionFloat>
The reaction to draw rising from user’s pointer at now.
pub fn talking(&self, user: &UserId, now: Instant) -> bool
pub fn talking(&self, user: &UserId, now: Instant) -> bool
Whether user is saying something at now: their pointer stays and
keeps its name while they do.
pub fn prune(&mut self, now: Instant) -> bool
pub fn prune(&mut self, now: Instant) -> bool
Drop messages that have lingered and reactions that are over. Returns whether anything went.
pub fn animating(&self, now: Instant) -> bool
pub fn animating(&self, now: Instant) -> bool
Whether anything is arriving, fading or floating at now, so the
painter needs another frame. Asks no more of the motion than the
slowest it can be: a host without the person’s motion settings may
paint a frame too many, never one too few.
pub fn next_change(
&self,
now: Instant,
motion: EffectiveMotion,
) -> Option<Instant>
pub fn next_change( &self, now: Instant, motion: EffectiveMotion, ) -> Option<Instant>
When the next change after now happens on its own (a sent message
starts to fade), for a host that sleeps between frames.
Trait Implementations§
§impl Clone for CursorChats
impl Clone for CursorChats
§fn clone(&self) -> CursorChats
fn clone(&self) -> CursorChats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for CursorChats
impl Debug for CursorChats
§impl Default for CursorChats
impl Default for CursorChats
§fn default() -> CursorChats
fn default() -> CursorChats
Auto Trait Implementations§
impl Freeze for CursorChats
impl RefUnwindSafe for CursorChats
impl Send for CursorChats
impl Sync for CursorChats
impl Unpin for CursorChats
impl UnsafeUnpin for CursorChats
impl UnwindSafe for CursorChats
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> 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>, 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>
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)
&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> 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>
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