pub struct ActuatorRating { /* private fields */ }Expand description
A descriptive actuator rating label with optional numeric metadata.
Implementations§
Source§impl ActuatorRating
impl ActuatorRating
Sourcepub fn new(label: impl AsRef<str>) -> Result<Self, ActuatorTextError>
pub fn new(label: impl AsRef<str>) -> Result<Self, ActuatorTextError>
Creates an actuator rating from a non-empty label.
§Errors
Returns ActuatorTextError::Empty when the trimmed label is empty.
Sourcepub fn with_value(self, value: f64) -> Result<Self, ActuatorRatingError>
pub fn with_value(self, value: f64) -> Result<Self, ActuatorRatingError>
Returns this rating with a finite numeric value attached.
§Errors
Returns ActuatorRatingError::NonFinite when value is not finite.
Sourcepub fn with_unit(self, unit: impl AsRef<str>) -> Result<Self, ActuatorTextError>
pub fn with_unit(self, unit: impl AsRef<str>) -> Result<Self, ActuatorTextError>
Returns this rating with a non-empty unit label attached.
§Errors
Returns ActuatorTextError::Empty when the unit is empty after trimming.
Trait Implementations§
Source§impl Clone for ActuatorRating
impl Clone for ActuatorRating
Source§fn clone(&self) -> ActuatorRating
fn clone(&self) -> ActuatorRating
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 ActuatorRating
impl Debug for ActuatorRating
Source§impl PartialEq for ActuatorRating
impl PartialEq for ActuatorRating
impl StructuralPartialEq for ActuatorRating
Auto Trait Implementations§
impl Freeze for ActuatorRating
impl RefUnwindSafe for ActuatorRating
impl Send for ActuatorRating
impl Sync for ActuatorRating
impl Unpin for ActuatorRating
impl UnsafeUnpin for ActuatorRating
impl UnwindSafe for ActuatorRating
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