[][src]Struct accel_stepper::CummulativeSteps

pub struct CummulativeSteps { /* fields omitted */ }

A helper type for determining the number of steps to take when moving a distance in the real world, taking rounding errors into consideration.

Methods

impl CummulativeSteps[src]

pub const fn new(steps_per_unit: f32) -> CummulativeSteps[src]

Create a new CummulativeSteps which will use the provided ratio as the number of steps to take per "real" unit.

pub const fn real_location(&self) -> f32[src]

The current location in "real" units.

pub const fn steps_per_unit(&self) -> f32[src]

Get the number of steps travelled per "real" unit.

pub const fn with_steps_per_unit(&self, steps_per_unit: f32) -> CummulativeSteps[src]

pub fn move_by(&mut self, delta: f32) -> i64[src]

Execute a relative movement, retrieving the number of steps to take.

Trait Implementations

impl PartialEq<CummulativeSteps> for CummulativeSteps[src]

impl Clone for CummulativeSteps[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for CummulativeSteps[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]