Struct Poller

Source
pub struct Poller<S, L = Identity> {
    pub stream: S,
    pub heartbeat: BoxFuture<'static, ()>,
    pub layer: L,
    /* private fields */
}
Expand description

A poller type that allows fetching from a stream and a heartbeat future that can be used to do periodic tasks

Fields§

§stream: S

The stream of jobs

§heartbeat: BoxFuture<'static, ()>

The heartbeat for the backend

§layer: L

The tower middleware provided by the backend

Implementations§

Source§

impl<S> Poller<S, Identity>

Source

pub fn new( stream: S, heartbeat: impl Future<Output = ()> + Send + 'static, ) -> Self

Build a new poller

Source

pub fn new_with_layer<L>( stream: S, heartbeat: impl Future<Output = ()> + Send + 'static, layer: L, ) -> Poller<S, L>

Build a poller with layer

Trait Implementations§

Source§

impl<S, L> Debug for Poller<S, L>
where S: Debug, L: Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<S, L> Freeze for Poller<S, L>
where S: Freeze, L: Freeze,

§

impl<S, L = Identity> !RefUnwindSafe for Poller<S, L>

§

impl<S, L> Send for Poller<S, L>
where S: Send, L: Send,

§

impl<S, L = Identity> !Sync for Poller<S, L>

§

impl<S, L> Unpin for Poller<S, L>
where S: Unpin, L: Unpin,

§

impl<S, L = Identity> !UnwindSafe for Poller<S, L>

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.
Source§

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

Source§

fn vzip(self) -> V