Skip to main content

Sink

Trait Sink 

Source
pub trait Sink<T> {
    type Error;

    // Required method
    fn try_push(&mut self, val: T) -> Result<(), Self::Error>;
}
Expand description

Accept events.

Error is the type returned when the sink cannot accept the value. Sinks that never reject (e.g. overwrite rings) use core::convert::Infallible.

§Implementors

Required Associated Types§

Source

type Error

The error returned when the sink cannot accept the value.

Required Methods§

Source

fn try_push(&mut self, val: T) -> Result<(), Self::Error>

Push a value into the sink.

Returns Ok(()) on success or Err(Self::Error) when the sink is unable to accept the value.

Implementors§

Source§

impl<T: Copy + Default, const N: usize> Sink<T> for RingBuf<T, N>

Source§

impl<T: Copy, const N: usize> Sink<T> for ph_eventing::event_buf::Producer<'_, T, N>

Source§

type Error = T

Source§

impl<T: Copy, const N: usize> Sink<T> for ph_eventing::seq_ring::Producer<'_, T, N>