Struct xplm::flight_loop::LoopState

source ·
pub struct LoopState<'a> { /* private fields */ }
Expand description

Information available during a flight loop callback

By default, a flight loop callback will continue to be called on its initial schedule. The scheduling functions only need to be called if the callback scheduling should change.

Implementations§

source§

impl<'a> LoopState<'a>

source

pub fn since_last_call(&self) -> Duration

Returns the duration since the last time this callback was called

source

pub fn since_last_loop(&self) -> Duration

Returns the duration since the last flight loop

If this callback is not called every flight loop, this may be different from the value returned from time_since_last_call.

source

pub fn counter(&self) -> i32

Returns the value of a counter that increments every time the callback is called

source

pub fn deactivate(&mut self)

Deactivates this flight loop. It will not be called again until it is scheduled.

source

pub fn call_next_loop(&mut self)

Configures this callback to be called on the next flight loop

source

pub fn call_after_loops(&mut self, loops: u32)

Configures this callback to be called after the specified number of loops

source

pub fn call_after(&mut self, time: Duration)

Configures this callback to be called after the provided duration

Trait Implementations§

source§

impl<'a> Debug for LoopState<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for LoopState<'a>

§

impl<'a> RefUnwindSafe for LoopState<'a>

§

impl<'a> Send for LoopState<'a>

§

impl<'a> Sync for LoopState<'a>

§

impl<'a> Unpin for LoopState<'a>

§

impl<'a> !UnwindSafe for LoopState<'a>

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

§

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.