Struct loro_internal::op::RichOp
source · pub struct RichOp<'a> {
pub op: &'a Op,
pub peer: PeerID,
pub lamport: Lamport,
pub timestamp: Timestamp,
pub start: usize,
pub end: usize,
}Expand description
RichOp includes lamport and timestamp info, which is used for conflict resolution.
Fields§
§op: &'a Op§peer: PeerID§lamport: Lamport§timestamp: Timestamp§start: usize§end: usizeImplementations§
source§impl<'a> RichOp<'a>
impl<'a> RichOp<'a>
pub fn new( op: &'a Op, client_id: PeerID, lamport: Lamport, timestamp: Timestamp ) -> Self
pub fn new_by_change(change: &Change<Op>, op: &'a Op) -> Self
sourcepub fn new_by_slice_on_change(
change: &Change<Op>,
start: i32,
end: i32,
op: &'a Op
) -> Self
pub fn new_by_slice_on_change( change: &Change<Op>, start: i32, end: i32, op: &'a Op ) -> Self
we want the overlap part of the op and change[start..end]
op is contained in the change, but it’s not necessary overlap with change[start..end]
pub fn get_sliced(&self) -> Op
pub fn as_owned(&self) -> OwnedRichOp
pub fn op(&self) -> &Op
pub fn client_id(&self) -> u64
pub fn timestamp(&self) -> i64
pub fn start(&self) -> usize
pub fn end(&self) -> usize
Trait Implementations§
source§impl<'a> HasLength for RichOp<'a>
impl<'a> HasLength for RichOp<'a>
source§fn content_len(&self) -> usize
fn content_len(&self) -> usize
It is the length of the content, i.e. the length when no Mergable::merge ever happen. Read more
Auto Trait Implementations§
impl<'a> RefUnwindSafe for RichOp<'a>
impl<'a> Send for RichOp<'a>
impl<'a> Sync for RichOp<'a>
impl<'a> Unpin for RichOp<'a>
impl<'a> UnwindSafe for RichOp<'a>
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> HasCounterSpan for Twhere
T: HasCounter + HasLength,
impl<T> HasCounterSpan for Twhere T: HasCounter + HasLength,
source§impl<T> HasIdSpan for Twhere
T: HasId + HasLength,
impl<T> HasIdSpan for Twhere T: HasId + HasLength,
source§impl<T> HasLamportSpan for Twhere
T: HasLamport + HasLength,
impl<T> HasLamportSpan for Twhere T: HasLamport + HasLength,
source§fn lamport_end(&self) -> u32
fn lamport_end(&self) -> u32
end is the exclusive end, last the inclusive end.
source§fn lamport_last(&self) -> u32
fn lamport_last(&self) -> u32
end is the exclusive end, last the inclusive end.