Struct QueuedServerReply

Source
pub struct QueuedServerReply<T> { /* private fields */ }
Expand description

Represents a reply where all sends are queued up but not sent until after the flush method is called. This reply supports injecting at the front of the queue in order to support sending messages but ensuring that some specific message is sent out first

Implementations§

Source§

impl<T> QueuedServerReply<T>

Source

pub fn hold(&self, hold: bool)

Updates the hold status for the queue

  • If true, all messages are held until the queue is flushed
  • If false, messages are sent directly as they come in
Source

pub fn send(&self, data: T) -> Result<()>

Send this message, adding it to a queue if holding messages.

Source

pub fn send_before(&self, data: T) -> Result<()>

Send this message before anything else in the queue

Source

pub fn flush(&self, hold: bool) -> Result<()>

Sends all pending msgs queued up and clears the queue

Additionally, takes hold to indicate whether or not new msgs after the flush should continue to be held within the queue or if all future msgs will be sent immediately

Source

pub fn is_closed(&self) -> bool

Trait Implementations§

Source§

impl<T> Clone for QueuedServerReply<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Send + 'static> Reply for QueuedServerReply<T>

Source§

type Data = T

Source§

fn send(&self, data: Self::Data) -> Result<()>

Sends a reply out from the server.
Source§

fn clone_reply(&self) -> Box<dyn Reply<Data = Self::Data>>

Clones this reply.

Auto Trait Implementations§

§

impl<T> Freeze for QueuedServerReply<T>

§

impl<T> RefUnwindSafe for QueuedServerReply<T>

§

impl<T> Send for QueuedServerReply<T>
where T: Send,

§

impl<T> Sync for QueuedServerReply<T>
where T: Send,

§

impl<T> Unpin for QueuedServerReply<T>

§

impl<T> UnwindSafe for QueuedServerReply<T>

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> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts reference to Any
Source§

fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)

Converts mutable reference to Any
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Consumes and produces Box<dyn Any>
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V