pub struct SyncNode { /* private fields */ }Implementations§
Source§impl SyncNode
impl SyncNode
Sourcepub async fn start(store: Arc<Mutex<Store>>) -> Result<Arc<Self>>
pub async fn start(store: Arc<Mutex<Store>>) -> Result<Arc<Self>>
Bind an endpoint and start serving. Identity is persisted, so a restart rejoins as the same peer with the same ticket.
pub fn ticket(&self) -> Ticket
pub fn peer_ids(&self) -> Vec<EndpointId> ⓘ
Sourcepub fn join(&self, ticket: &Ticket) -> Result<()>
pub fn join(&self, ticket: &Ticket) -> Result<()>
Adopt a ticket: remember the peer and, since the room key names the group, switch to theirs.
Joining is deliberately one-way — the joiner moves to the host’s room rather than negotiating — so “I sent you a ticket” has an unambiguous result.
Sourcepub async fn run(self: Arc<Self>, notify: Arc<Notify>)
pub async fn run(self: Arc<Self>, notify: Arc<Notify>)
Background driver: sync on every local change, and on a timer so peers that were offline still catch up.
pub async fn sync_all(&self)
Sourcepub async fn sync_with(&self, peer: EndpointId) -> Result<usize>
pub async fn sync_with(&self, peer: EndpointId) -> Result<usize>
Dial a peer and run one full exchange. Returns how many entries this replica took from them.
Auto Trait Implementations§
impl !Freeze for SyncNode
impl !RefUnwindSafe for SyncNode
impl !UnwindSafe for SyncNode
impl Send for SyncNode
impl Sync for SyncNode
impl Unpin for SyncNode
impl UnsafeUnpin for SyncNode
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> 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