pub struct Factor(/* private fields */);
Expand description
Implementations§
source§impl Factor
impl Factor
sourcepub fn try_new(val: f32) -> Option<Self>
pub fn try_new(val: f32) -> Option<Self>
Tries to create a new factor, will be None
if val
is not between or equal to 0 and 1
sourcepub const unsafe fn new_unchecked(val: f32) -> Self
pub const unsafe fn new_unchecked(val: f32) -> Self
Creates a new factor without checking bounds
§Unsafe
An out of bounds factor might throw up important logic
Should only be used for creating literals
sourcepub fn get_duty_for(self, max_duty: u16) -> u16
pub fn get_duty_for(self, max_duty: u16) -> u16
embedded_hal helper function
Trait Implementations§
source§impl<'de> Deserialize<'de> for Factor
impl<'de> Deserialize<'de> for Factor
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Factor
impl PartialEq for Factor
source§impl PartialOrd for Factor
impl PartialOrd for Factor
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Factor
impl StructuralPartialEq for Factor
Auto Trait Implementations§
impl Freeze for Factor
impl RefUnwindSafe for Factor
impl Send for Factor
impl Sync for Factor
impl Unpin for Factor
impl UnwindSafe for Factor
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