Skip to main content

RealtimeRound

Struct RealtimeRound 

Source
pub struct RealtimeRound { /* private fields */ }
Expand description

The per-connection round state: at most one round in flight (§8.7). A native transport creates one of these per socket and drives it from its reader loop (route_binary) and its realtime_sync call (begin/finish).

Implementations§

Source§

impl RealtimeRound

Source

pub fn new() -> Self

Source

pub fn in_flight(&self) -> bool

True while a round is in flight (request sent, response not yet at END). The client-side enforcement of §8.7’s “one round in flight”.

Source

pub fn begin(&mut self, request: &[u8]) -> Result<Vec<u8>, TransportError>

Frame the request for the socket: a 0x01 tag byte followed by the whole request envelope. Chunk boundaries are arbitrary (§8.7), so a single chunk carrying the entire request is legal and simplest; the request is already bounded (bulk rides segments over HTTP, §5.7), so there is nothing to gain by splitting it. Marks the round in flight.

Returns an error if a round is already in flight (client-side §8.7 one-in-flight enforcement — the caller must not pipeline).

Source

pub fn route_binary( &mut self, frame: &[u8], ) -> Result<RoundInbound, TransportError>

Route one inbound binary frame (tag byte + payload) while a round may be in flight. 0x01 chunks feed the response scanner; 0x00 deltas are surfaced for the inbound queue; unknown tags are ignored.

On a scanner error (bad envelope header) or bytes past END, the round is failed and the error returned — the caller wakes the pending realtime_sync with it and (per §8.7) the connection is unusable.

Source

pub fn abort(&mut self)

Abandon any in-flight round (socket dropped mid-round). Clears the in-flight flag so the connection can be re-established.

Trait Implementations§

Source§

impl Default for RealtimeRound

Source§

fn default() -> RealtimeRound

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.