pub struct Anchor {
pub timestamp: Lamport,
pub offset: usize,
pub bias: Bias,
pub buffer_id: Option<u64>,
}
Fields§
§timestamp: Lamport
§offset: usize
§bias: Bias
§buffer_id: Option<u64>
Implementations§
source§impl Anchor
impl Anchor
pub const MIN: Anchor = Self{ timestamp: clock::Lamport::MIN, offset: usize::MIN, bias: Bias::Left, buffer_id: None,}
pub const MAX: Anchor = Self{ timestamp: clock::Lamport::MAX, offset: usize::MAX, bias: Bias::Right, buffer_id: None,}
pub fn cmp(&self, other: &Anchor, buffer: &BufferSnapshot) -> Ordering
pub fn min(&self, other: &Anchor, buffer: &BufferSnapshot) -> Anchor
pub fn max(&self, other: &Anchor, buffer: &BufferSnapshot) -> Anchor
pub fn bias(&self, bias: Bias, buffer: &BufferSnapshot) -> Anchor
pub fn bias_left(&self, buffer: &BufferSnapshot) -> Anchor
pub fn bias_right(&self, buffer: &BufferSnapshot) -> Anchor
pub fn summary<D>(&self, content: &BufferSnapshot) -> Dwhere D: TextDimension,
sourcepub fn is_valid(&self, buffer: &BufferSnapshot) -> bool
pub fn is_valid(&self, buffer: &BufferSnapshot) -> bool
Returns true when the Anchor is located inside a visible fragment.
Trait Implementations§
source§impl PartialEq<Anchor> for Anchor
impl PartialEq<Anchor> for Anchor
source§impl ToOffsetUtf16 for Anchor
impl ToOffsetUtf16 for Anchor
fn to_offset_utf16(&self, snapshot: &BufferSnapshot) -> OffsetUtf16
source§impl ToPointUtf16 for Anchor
impl ToPointUtf16 for Anchor
fn to_point_utf16(&self, snapshot: &BufferSnapshot) -> PointUtf16
impl Copy for Anchor
impl Eq for Anchor
impl StructuralEq for Anchor
impl StructuralPartialEq for Anchor
Auto Trait Implementations§
impl RefUnwindSafe for Anchor
impl Send for Anchor
impl Sync for Anchor
impl Unpin for Anchor
impl UnwindSafe for Anchor
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> 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> IsDefault for Twhere
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for Twhere T: Default + PartialEq<T> + Copy,
source§fn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ResetDiscriminant<T> for Twhere
T: Copy,
impl<T> ResetDiscriminant<T> for Twhere T: Copy,
§fn discriminant(&self) -> T
fn discriminant(&self) -> T
Value based on which equality for the reset will be determined.