pub struct CummulativeSteps { /* private fields */ }
Expand description
A helper type for determining the number of steps to take when moving a distance in the real world, taking rounding errors into consideration.
Implementations§
Source§impl CummulativeSteps
impl CummulativeSteps
Sourcepub const fn new(steps_per_unit: f32) -> CummulativeSteps
pub const fn new(steps_per_unit: f32) -> CummulativeSteps
Create a new CummulativeSteps
which will use the provided ratio as
the number of steps to take per “real” unit.
Sourcepub const fn real_location(&self) -> f32
pub const fn real_location(&self) -> f32
The current location in “real” units.
Sourcepub const fn steps_per_unit(&self) -> f32
pub const fn steps_per_unit(&self) -> f32
Get the number of steps travelled per “real” unit.
pub const fn with_steps_per_unit(&self, steps_per_unit: f32) -> CummulativeSteps
Trait Implementations§
Source§impl Clone for CummulativeSteps
impl Clone for CummulativeSteps
Source§fn clone(&self) -> CummulativeSteps
fn clone(&self) -> CummulativeSteps
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CummulativeSteps
impl Debug for CummulativeSteps
Source§impl PartialEq for CummulativeSteps
impl PartialEq for CummulativeSteps
impl StructuralPartialEq for CummulativeSteps
Auto Trait Implementations§
impl Freeze for CummulativeSteps
impl RefUnwindSafe for CummulativeSteps
impl Send for CummulativeSteps
impl Sync for CummulativeSteps
impl Unpin for CummulativeSteps
impl UnwindSafe for CummulativeSteps
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