Skip to main content

PublicationQueue

Struct PublicationQueue 

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

A bounded FIFO whose render-side operation performs no transport I/O.

A marker is returned only after the complete validated snapshot+commit pair has been encoded and admitted atomically. Full queues consume no revision. A transport failure permanently closes admission.

Implementations§

Source§

impl PublicationQueue

Source

pub fn new(client: Client, capacity: usize) -> Result<Self, Error>

Move a connected client into a dedicated writer thread.

Construct this only after the handshake; dormant applications never create a queue or thread. Capacity must be positive.

Source

pub fn limits(&self) -> &Limits

Negotiated snapshot limits used by a framework tree builder.

Source

pub fn publish( &mut self, snapshot: &mut Snapshot, ) -> Result<Option<String>, Error>

Validate, encode and non-blockingly admit one complete revision.

Source

pub fn dropped(&self) -> u64

Revisions dropped before admission because the FIFO was full.

Source

pub fn failed(&self) -> bool

Whether transport failed and no later marker may be issued.

Source

pub fn fail(&mut self, code: impl Into<String>, message: impl Into<String>)

Fail closed without writing from the caller’s thread. Already-admitted revisions drain in order, then the worker sends the typed fatal.

Source

pub fn shutdown(self) -> bool

Close admission, drain the ordered worker and wait for its causal completion. Framework lifecycle code calls this outside render hooks so a short-lived one-frame process cannot exit ahead of its semantic data. Returns whether the worker completed without a transport failure.

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, <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.