Skip to main content

PreparedSyncRound

Struct PreparedSyncRound 

Source
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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn finish(self) -> Option<CompletedSyncRound>

The completed round once every operation is answered, ready for SyncClient::apply_sync_round.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.