#[non_exhaustive]pub enum StateEventContent {
#[non_exhaustive] PeerSynced {
peer_id: PeerId,
discovery_key: FeedDiscoveryKey,
contiguous_length: u64,
},
#[non_exhaustive] RemotePeerSynced {
peer_id: PeerId,
discovery_key: FeedDiscoveryKey,
contiguous_length: u64,
},
#[non_exhaustive] PeerChanged {
peer_id: PeerId,
discovery_key: FeedDiscoveryKey,
replaced_discovery_key: Option<FeedDiscoveryKey>,
},
#[non_exhaustive] DocumentInitialized {
new_document: bool,
child: bool,
parent_document_ids: Vec<DocumentId>,
},
#[non_exhaustive] DocumentChanged {
change_id: Option<Vec<u8>>,
patches: Vec<Patch>,
},
}Expand description
Content of a StateEvent
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
#[non_exhaustive]PeerSynced
Remote peer’s data was synced to local document
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
discovery_key: FeedDiscoveryKeyDiscovery key of peer’s feed
#[non_exhaustive]RemotePeerSynced
Remote peer got local data
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
discovery_key: FeedDiscoveryKeyDiscovery key of the feed
#[non_exhaustive]PeerChanged
Peer’s feed got replaced. NB: Listen to this for in-memory peers and if peer_id matches local peer_id, store (and replace) value from reattach_secret() so that it can be given back when re-attaching the document.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
discovery_key: FeedDiscoveryKeyNew discovery key
§
replaced_discovery_key: Option<FeedDiscoveryKey>Discovery key that was replaced
#[non_exhaustive]DocumentInitialized
Document was initialized and is now ready to transact with.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
parent_document_ids: Vec<DocumentId>All the document ids that are parents to this document. This can have multiple values if another parent of the document is being proxied in this peermerge.
#[non_exhaustive]DocumentChanged
Document was changed
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Trait Implementations§
Source§impl Clone for StateEventContent
impl Clone for StateEventContent
Source§fn clone(&self) -> StateEventContent
fn clone(&self) -> StateEventContent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StateEventContent
impl RefUnwindSafe for StateEventContent
impl Send for StateEventContent
impl Sync for StateEventContent
impl Unpin for StateEventContent
impl UnwindSafe for StateEventContent
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,
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>
Converts
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>
Converts
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