pub struct ImpulseClass { /* private fields */ }Expand description
A motor’s impulse class, such as 1/4A, C or M.
Serializes as its label ("1/2A", "H").
Implementations§
Source§impl ImpulseClass
impl ImpulseClass
Sourcepub fn from_total_impulse(total_impulse_ns: f64) -> Result<Self, MotorError>
pub fn from_total_impulse(total_impulse_ns: f64) -> Result<Self, MotorError>
The class a total impulse falls in. Upper limits are inclusive: 2.5 N·s is an A, and
anything above it up to 5 N·s is a B.
§Errors
MotorError::Domain when the impulse is not finite, not positive, or above the Z limit
(1.25 · 2²⁶ N·s).
Sourcepub fn upper_limit_ns(self) -> f64
pub fn upper_limit_ns(self) -> f64
The largest total impulse in the class, N·s (inclusive).
Sourcepub fn lower_limit_ns(self) -> f64
pub fn lower_limit_ns(self) -> f64
The largest total impulse of the class below, N·s (exclusive); zero for 1/8A.
Trait Implementations§
Source§impl Clone for ImpulseClass
impl Clone for ImpulseClass
Source§fn clone(&self) -> ImpulseClass
fn clone(&self) -> ImpulseClass
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ImpulseClass
Source§impl Debug for ImpulseClass
impl Debug for ImpulseClass
Source§impl<'de> Deserialize<'de> for ImpulseClass
impl<'de> Deserialize<'de> for ImpulseClass
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 Display for ImpulseClass
impl Display for ImpulseClass
impl Eq for ImpulseClass
Source§impl From<ImpulseClass> for String
impl From<ImpulseClass> for String
Source§fn from(class: ImpulseClass) -> Self
fn from(class: ImpulseClass) -> Self
Converts to this type from the input type.
Source§impl FromStr for ImpulseClass
impl FromStr for ImpulseClass
Source§impl Hash for ImpulseClass
impl Hash for ImpulseClass
Source§impl Ord for ImpulseClass
impl Ord for ImpulseClass
Source§fn cmp(&self, other: &ImpulseClass) -> Ordering
fn cmp(&self, other: &ImpulseClass) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ImpulseClass
impl PartialEq for ImpulseClass
Source§fn eq(&self, other: &ImpulseClass) -> bool
fn eq(&self, other: &ImpulseClass) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ImpulseClass
impl PartialOrd for ImpulseClass
Source§impl Serialize for ImpulseClass
impl Serialize for ImpulseClass
impl StructuralPartialEq for ImpulseClass
Auto Trait Implementations§
impl Freeze for ImpulseClass
impl RefUnwindSafe for ImpulseClass
impl Send for ImpulseClass
impl Sync for ImpulseClass
impl Unpin for ImpulseClass
impl UnsafeUnpin for ImpulseClass
impl UnwindSafe for ImpulseClass
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