pub struct MessageRange { /* private fields */ }Expand description
Half-open range [start, end) of message offsets within a session’s
history that a memory entry was derived from.
This is the typed source-provenance handle: it records the origin of the indexed content (which messages it came from), independent of when the entry happened to be indexed.
Implementations§
Source§impl MessageRange
impl MessageRange
Sourcepub fn new(start: u64, end: u64) -> Result<Self, MemoryStoreError>
pub fn new(start: u64, end: u64) -> Result<Self, MemoryStoreError>
Construct a half-open range [start, end).
Fails closed when start > end rather than silently normalizing —
an inverted range is a provenance bug at the call site.
pub fn start(&self) -> u64
pub fn end(&self) -> u64
pub fn is_empty(&self) -> bool
Sourcepub fn overlaps(&self, other: &MessageRange) -> bool
pub fn overlaps(&self, other: &MessageRange) -> bool
Whether this half-open range overlaps other.
Half-open semantics: ranges that merely touch (self.end == other.start) do not overlap, and an empty range overlaps nothing.
Trait Implementations§
Source§impl Clone for MessageRange
impl Clone for MessageRange
Source§fn clone(&self) -> MessageRange
fn clone(&self) -> MessageRange
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MessageRange
Source§impl Debug for MessageRange
impl Debug for MessageRange
Source§impl<'de> Deserialize<'de> for MessageRange
impl<'de> Deserialize<'de> for MessageRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MessageRange
Source§impl PartialEq for MessageRange
impl PartialEq for MessageRange
Source§fn eq(&self, other: &MessageRange) -> bool
fn eq(&self, other: &MessageRange) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MessageRange
impl Serialize for MessageRange
impl StructuralPartialEq for MessageRange
Auto Trait Implementations§
impl Freeze for MessageRange
impl RefUnwindSafe for MessageRange
impl Send for MessageRange
impl Sync for MessageRange
impl Unpin for MessageRange
impl UnsafeUnpin for MessageRange
impl UnwindSafe for MessageRange
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.