Struct crs_bind::rtos::Broadcast[][src]

pub struct Broadcast<T: Clone>(_);

Represents a source of data which notifies listeners on a new value.

Implementations

impl<T: Clone> Broadcast<T>[src]

pub fn new(data: T) -> Self[src]

Creates a new broadcast event with the associated initial value. Panics on failure; see Broadcast::try_new().

pub fn try_new(data: T) -> Result<Self, Error>[src]

Creates a new broadcast event with the associated initial value.

pub fn value(&self) -> T[src]

Gets a copy of the current value of the broadcast event.

pub fn listen(&self) -> BroadcastListener<'_, T>[src]

Creates a new listener for the broadcast event.

pub fn publish(&self, data: T)[src]

Publishes a new value for the broadcast event.

Auto Trait Implementations

impl<T> Send for Broadcast<T> where
    T: Send + Sync

impl<T> Sync for Broadcast<T> where
    T: Send + Sync

impl<T> Unpin for Broadcast<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.