pub struct PreparedSyncRound { /* private fields */ }Expand description
Immutable request and blob bodies captured by the mutable client owner. Send this value to an I/O executor; it contains no SQLite connection.
Implementations§
Source§impl PreparedSyncRound
impl PreparedSyncRound
Sourcepub fn exchange(self, transport: &mut dyn Transport) -> CompletedSyncRound
pub fn exchange(self, transport: &mut dyn Transport) -> CompletedSyncRound
Run network I/O without accessing client state. Download errors stay at their descriptor’s position so apply retains the same completed prefix.
This drives the same RoundOperation sequence that a non-blocking
host drives itself, so both paths share every decision the client
makes about uploads, segment fetches, and deadline state.
Sourcepub fn request_bytes(&self) -> Vec<u8> ⓘ
pub fn request_bytes(&self) -> Vec<u8> ⓘ
The encoded round message (§1.5). Uploads listed by
RoundOperation::UploadGrant precede it; a host that drives the round
with exchange never needs this call.
Sourcepub fn next_operation(&mut self) -> Option<RoundOperation<'_>>
pub fn next_operation(&mut self) -> Option<RoundOperation<'_>>
The next network operation a host must perform, or None once every
operation of the current exchange is answered. Call
PreparedSyncRound::submit with its result, then repeat.
After an upload operation completes, the round is complete for this
exchange: call PreparedSyncRound::finish and apply it, so the owner
persists the pin removal before the metadata request. The applied
round’s Continue returns the prepared round for the next exchange.
Sourcepub fn submit(&mut self, reply: RoundReply) -> Result<(), TransportError>
pub fn submit(&mut self, reply: RoundReply) -> Result<(), TransportError>
Hand the result of the last PreparedSyncRound::next_operation back.
A reply of the wrong kind fails with client.invalid_round_reply and
leaves the round where it was.
Sourcepub fn finish(self) -> Option<CompletedSyncRound>
pub fn finish(self) -> Option<CompletedSyncRound>
The completed round once every operation is answered, ready for
SyncClient::apply_sync_round.