pub(crate) struct MessageCacheKey {
pub(crate) transaction_id: Option<OwnedTransactionId>,
pub(crate) event_id: Option<OwnedEventId>,
pub(crate) is_edited: bool,
}Expand description
The data used as a cache key for messages.
This is used when there is no reliable way to detect if the content of a message changed. For example, the URI of a media file might change between a local echo and a remote echo, but we do not need to reload the media in this case, and we have no other way to know that both URIs point to the same file.
Fields§
§transaction_id: Option<OwnedTransactionId>The transaction ID of the event.
Local echo should keep its transaction ID after the message is sent, so we do not need to reload the message if it did not change.
event_id: Option<OwnedEventId>The global ID of the event.
Local echo that was sent and remote echo should have the same event ID, so we do not need to reload the message if it did not change.
is_edited: boolWhether the message is edited.
The message must be reloaded when it was edited.
Implementations§
Source§impl MessageCacheKey
impl MessageCacheKey
Sourcepub(crate) fn should_reload(&self, new: &MessageCacheKey) -> bool
pub(crate) fn should_reload(&self, new: &MessageCacheKey) -> bool
Whether the given new MessageCacheKey should trigger a reload of the
message compared to this one.
Trait Implementations§
Source§impl Clone for MessageCacheKey
impl Clone for MessageCacheKey
Source§fn clone(&self) -> MessageCacheKey
fn clone(&self) -> MessageCacheKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MessageCacheKey
impl Debug for MessageCacheKey
Source§impl Default for MessageCacheKey
impl Default for MessageCacheKey
Source§fn default() -> MessageCacheKey
fn default() -> MessageCacheKey
Auto Trait Implementations§
impl Freeze for MessageCacheKey
impl RefUnwindSafe for MessageCacheKey
impl Send for MessageCacheKey
impl Sync for MessageCacheKey
impl Unpin for MessageCacheKey
impl UnsafeUnpin for MessageCacheKey
impl UnwindSafe for MessageCacheKey
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,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
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