Skip to main content

Sender

Struct Sender 

Source
pub struct Sender<T, S: SwapSlot<T>> { /* private fields */ }

Implementations§

Source§

impl<T, S: SwapSlot<T>> Sender<T, S>

Source

pub fn broadcast(&self, object: T) -> Result<(), SendError<T>>

Publishes values to the circular buffer at wi % size

§Arguments
  • object - owned object to be published
Source

pub fn len(&self) -> usize

Returns the length of the queue

Source

pub fn is_empty(&self) -> bool

Checks if nothings has been published yet

Source

pub fn close(&self)

Closes the Sender

Trait Implementations§

Source§

impl<T: Debug, S: Debug + SwapSlot<T>> Debug for Sender<T, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, S: SwapSlot<T>> Drop for Sender<T, S>

Drop trait is used to let subscribers know that publisher is no longer available.

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<T, S: SwapSlot<T>> From<Arc<Channel<T, S>>> for Sender<T, S>

Source§

fn from(arc_channel: Arc<Channel<T, S>>) -> Self

Converts to this type from the input type.
Source§

impl<T, S: SwapSlot<T>> PartialEq for Sender<T, S>

Source§

fn eq(&self, other: &Sender<T, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, S: SwapSlot<T>> Eq for Sender<T, S>

Auto Trait Implementations§

§

impl<T, S> Freeze for Sender<T, S>

§

impl<T, S> RefUnwindSafe for Sender<T, S>

§

impl<T, S> Send for Sender<T, S>
where T: Sync + Send, S: Sync + Send,

§

impl<T, S> Sync for Sender<T, S>
where T: Sync + Send, S: Sync + Send,

§

impl<T, S> Unpin for Sender<T, S>

§

impl<T, S> UnsafeUnpin for Sender<T, S>

§

impl<T, S> UnwindSafe for Sender<T, S>

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