pub struct IntervalImmediateSubscription<M, F>{ /* private fields */ }Expand description
A subscription that fires immediately, then at regular intervals.
Unlike TickSubscription, this fires the first message immediately
without waiting for the interval.
§Example
ⓘ
IntervalImmediateSubscription::new(Duration::from_secs(1), || Msg::Tick)Implementations§
Trait Implementations§
Source§impl<M: Send + 'static, F: Fn() -> M + Send + 'static> Subscription<M> for IntervalImmediateSubscription<M, F>
impl<M: Send + 'static, F: Fn() -> M + Send + 'static> Subscription<M> for IntervalImmediateSubscription<M, F>
Source§fn into_stream(
self: Box<Self>,
cancel: CancellationToken,
) -> Pin<Box<dyn Stream<Item = M> + Send>>
fn into_stream( self: Box<Self>, cancel: CancellationToken, ) -> Pin<Box<dyn Stream<Item = M> + Send>>
Converts this subscription into a stream of messages. Read more
Auto Trait Implementations§
impl<M, F> Freeze for IntervalImmediateSubscription<M, F>where
F: Freeze,
impl<M, F> RefUnwindSafe for IntervalImmediateSubscription<M, F>where
F: RefUnwindSafe,
impl<M, F> Send for IntervalImmediateSubscription<M, F>
impl<M, F> Sync for IntervalImmediateSubscription<M, F>where
F: Sync,
impl<M, F> Unpin for IntervalImmediateSubscription<M, F>where
F: Unpin,
impl<M, F> UnwindSafe for IntervalImmediateSubscription<M, F>where
F: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<M, S> SubscriptionExt<M> for Swhere
S: Subscription<M>,
impl<M, S> SubscriptionExt<M> for Swhere
S: Subscription<M>,
Source§fn map<N, F>(self, f: F) -> MappedSubscription<M, N, F, Self>
fn map<N, F>(self, f: F) -> MappedSubscription<M, N, F, Self>
Maps the messages of this subscription. Read more
Source§fn filter<P>(self, predicate: P) -> FilterSubscription<M, Self, P>
fn filter<P>(self, predicate: P) -> FilterSubscription<M, Self, P>
Filters messages from this subscription. Read more
Source§fn take(self, count: usize) -> TakeSubscription<M, Self>
fn take(self, count: usize) -> TakeSubscription<M, Self>
Takes only the first N messages from this subscription. Read more