Struct leptos_use::UseIntervalReturn

source ·
pub struct UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
where PauseFn: Fn() + Clone, ResumeFn: Fn() + Clone, ResetFn: Fn() + Clone,
{ 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>
where PauseFn: Fn() + Clone, ResumeFn: Fn() + Clone, ResetFn: Fn() + Clone,

source

pub fn counter(self, value: Signal<u64>) -> Self

Counter signal that increases by one every interval.

source

pub fn reset<New__ResetFn>( self, value: New__ResetFn ) -> UseIntervalReturn<PauseFn, ResumeFn, New__ResetFn>
where PauseFn: Fn() + Clone, ResumeFn: Fn() + Clone, New__ResetFn: Fn() + Clone,

Reset the counter to zero

source

pub fn is_active(self, value: Signal<bool>) -> Self

A Signal that indicates whether the counter is active. false when paused.

source

pub fn pause<New__PauseFn>( self, value: New__PauseFn ) -> UseIntervalReturn<New__PauseFn, ResumeFn, ResetFn>
where New__PauseFn: Fn() + Clone, ResumeFn: Fn() + Clone, ResetFn: Fn() + Clone,

Temporarily pause the counter

source

pub fn resume<New__ResumeFn>( self, value: New__ResumeFn ) -> UseIntervalReturn<PauseFn, New__ResumeFn, ResetFn>
where PauseFn: Fn() + Clone, New__ResumeFn: Fn() + Clone, ResetFn: Fn() + Clone,

Resume the counter

Auto Trait Implementations§

§

impl<PauseFn, ResumeFn, ResetFn> Freeze for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>
where ResetFn: Freeze, PauseFn: Freeze, ResumeFn: Freeze,

§

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>
where ResetFn: Unpin, PauseFn: Unpin, ResumeFn: Unpin,

§

impl<PauseFn, ResumeFn, ResetFn> !UnwindSafe for UseIntervalReturn<PauseFn, ResumeFn, ResetFn>

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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more