pub struct Op<A> {
pub id: EntryId,
pub actions: NonEmpty<A>,
pub author: ActorId,
pub timestamp: Timestamp,
pub parents: Vec<EntryId>,
pub related: Vec<Oid>,
pub identity: Option<Oid>,
pub manifest: Manifest,
}Expand description
The Op is the operation that is applied onto a state to form a CRDT.
Everything that can be done in the system is represented by an Op.
Operations are applied to an accumulator to yield a final state.
Fields§
§id: EntryIdId of the entry under which this operation lives.
actions: NonEmpty<A>The action carried out by this operation.
The author of the operation.
timestamp: TimestampTimestamp of this operation.
parents: Vec<EntryId>Parent operations.
Related objects.
identity: Option<Oid>Head of identity document committed to by this operation.
manifest: ManifestObject manifest.
Implementations§
Source§impl<A> Op<A>
impl<A> Op<A>
pub fn new( id: EntryId, actions: impl Into<NonEmpty<A>>, author: ActorId, timestamp: impl Into<Timestamp>, identity: Option<Oid>, manifest: Manifest, ) -> Self
pub fn id(&self) -> EntryId
pub fn identity_doc<R: ReadRepository>( &self, repo: &R, ) -> Result<Option<DocAt>, DocError>
pub fn manifest_of<S>(store: &S, id: &Oid) -> Result<Manifest, ManifestError>
Trait Implementations§
Source§impl<A: 'static> IntoIterator for Op<A>
impl<A: 'static> IntoIterator for Op<A>
Source§impl<A: Eq> Ord for Op<A>
impl<A: Eq> Ord for Op<A>
Source§impl<A: Eq> PartialOrd for Op<A>
impl<A: Eq> PartialOrd for Op<A>
Source§impl<'a, A> TryFrom<&'a Entry<Oid, Oid, ExtendedSignature>> for Op<A>where
for<'de> A: Deserialize<'de>,
impl<'a, A> TryFrom<&'a Entry<Oid, Oid, ExtendedSignature>> for Op<A>where
for<'de> A: Deserialize<'de>,
impl<A: Eq> Eq for Op<A>
impl<A> StructuralPartialEq for Op<A>
Auto Trait Implementations§
impl<A> Freeze for Op<A>where
A: Freeze,
impl<A> RefUnwindSafe for Op<A>where
A: RefUnwindSafe,
impl<A> Send for Op<A>where
A: Send,
impl<A> Sync for Op<A>where
A: Sync,
impl<A> Unpin for Op<A>where
A: Unpin,
impl<A> UnwindSafe for Op<A>where
A: UnwindSafe,
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> CheckedSum<usize> for Twhere
T: IntoIterator<Item = usize>,
impl<T> CheckedSum<usize> for Twhere
T: IntoIterator<Item = usize>,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.