Skip to main content

Inbox

Struct Inbox 

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

A node’s reader on one of its input queues.

Implementations§

Source§

impl<T> Inbox<T>

Source

pub fn cx(&self) -> &Rc<NodeCx>

The node context the inbox charges.

Source

pub fn poll_peek(&self) -> Poll<Ref<'_, Item<T>>>

The next item, if one is waiting; otherwise Pending, with the node set to wait for input. Does not move past the item and does not charge the budget.

Source

pub fn advance(&self)

Moves past the next item. The end of the stream stays.

Source

pub fn peek_with<'a, R, F>(&'a self, f: F) -> impl Future<Output = R> + 'a
where F: FnOnce(&Item<T>) -> R + 'a,

Waits for the next item and reads it through f without taking it. Waits for budget first, so that a node looking at many items yields like one taking them.

Source

pub fn take(&self)

Takes the item last peeked at: moves past it and counts the operation.

Source

pub fn head_time(&self) -> Option<Tick>

The time of the item at the head, if one is waiting; see Item::time.

Source

pub fn recv(&mut self) -> impl Future<Output = Item<T>> + '_
where T: Clone,

Waits for the next item and takes it; the end of the stream is returned again and again.

Trait Implementations§

Source§

impl<T> Debug for Inbox<T>

Source§

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

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

impl<T> Drop for Inbox<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<T> Readable for Inbox<T>

Source§

fn poll_ready(&self) -> Poll<()>

Ready when an item (or a block of samples) is there to read without waiting; sets the node to wait for input otherwise.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Inbox<T>

§

impl<T> !Send for Inbox<T>

§

impl<T> !Sync for Inbox<T>

§

impl<T> !UnwindSafe for Inbox<T>

§

impl<T> Freeze for Inbox<T>
where Rc<RefCell<Broadcast<T>>>: Freeze,

§

impl<T> Unpin for Inbox<T>
where Rc<RefCell<Broadcast<T>>>: Unpin,

§

impl<T> UnsafeUnpin for Inbox<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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.