pub struct UseIntervalReturn<PauseFn, ResumeFn, ResetFn>{
pub counter: Signal<u64>,
pub reset: ResetFn,
pub is_active: Signal<bool>,
pub pause: PauseFn,
pub resume: ResumeFn,
}
Expand description
Return type of use_interval
.
Fields§
§counter: Signal<u64>
Counter signal that increases by one every interval.
reset: ResetFn
Reset the counter to zero
is_active: Signal<bool>
A Signal that indicates whether the counter is active. false
when paused.
pause: PauseFn
Temporarily pause the counter
resume: ResumeFn
Resume the counter
Implementations§
Source§impl<PauseFn, ResumeFn, ResetFn> UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
Sourcepub fn counter(self, value: Signal<u64>) -> Self
pub fn counter(self, value: Signal<u64>) -> Self
Counter signal that increases by one every interval.
Sourcepub fn reset<New__ResetFn>(
self,
value: New__ResetFn,
) -> UseIntervalReturn<PauseFn, ResumeFn, New__ResetFn>
pub fn reset<New__ResetFn>( self, value: New__ResetFn, ) -> UseIntervalReturn<PauseFn, ResumeFn, New__ResetFn>
Reset the counter to zero
Sourcepub fn is_active(self, value: Signal<bool>) -> Self
pub fn is_active(self, value: Signal<bool>) -> Self
A Signal that indicates whether the counter is active. false
when paused.
Sourcepub fn pause<New__PauseFn>(
self,
value: New__PauseFn,
) -> UseIntervalReturn<New__PauseFn, ResumeFn, ResetFn>
pub fn pause<New__PauseFn>( self, value: New__PauseFn, ) -> UseIntervalReturn<New__PauseFn, ResumeFn, ResetFn>
Temporarily pause the counter
Auto Trait Implementations§
impl<PauseFn, ResumeFn, ResetFn> Freeze for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> !RefUnwindSafe for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> !Send for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> !Sync for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> Unpin for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
impl<PauseFn, ResumeFn, ResetFn> !UnwindSafe for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more