pub enum SyncCommand {
SendEntries {
peer: PeerId,
entries: Vec<Entry>,
},
SyncWithPeer {
peer: PeerId,
},
Shutdown,
AddTransport {
name: String,
transport: Box<dyn SyncTransport>,
response: Sender<Result<()>>,
},
StartServer {
name: Option<String>,
response: Sender<Result<()>>,
},
StopServer {
name: Option<String>,
response: Sender<Result<()>>,
},
GetServerAddress {
name: String,
response: Sender<Result<String>>,
},
GetAllServerAddresses {
response: Sender<Result<Vec<(String, String)>>>,
},
ConnectToPeer {
address: Address,
response: Sender<Result<PublicKey>>,
},
SendRequest {
address: Address,
request: Box<SyncRequest>,
response: Sender<Result<SyncResponse>>,
},
Flush {
response: Sender<Result<()>>,
},
}Expand description
Commands that can be sent to the background sync engine
Variants§
SendEntries
Send entries to a specific peer
SyncWithPeer
Trigger immediate sync with a peer
Shutdown
Shutdown the background engine
AddTransport
Add a named transport to the transport manager
StartServer
Start the sync server on specified or all transports
Fields
StopServer
Stop the sync server on specified or all transports
Fields
GetServerAddress
Get the server’s listening address for a specific transport
GetAllServerAddresses
Get all server addresses for running servers
ConnectToPeer
Connect to a peer and perform handshake
SendRequest
Send a sync request and get response
Flush
Flush: process all queued entries and retry queue, then respond.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncCommand
impl !RefUnwindSafe for SyncCommand
impl Send for SyncCommand
impl Sync for SyncCommand
impl Unpin for SyncCommand
impl !UnwindSafe for SyncCommand
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<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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