pub struct ComponentValue(/* private fields */);Expand description
A descriptive component value such as 10k, 100nF, or STM32F4.
Implementations§
Source§impl ComponentValue
impl ComponentValue
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ComponentTextError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ComponentTextError>
Creates a component value from non-empty text.
§Errors
Returns ComponentTextError::Empty when the trimmed value is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the value and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for ComponentValue
impl AsRef<str> for ComponentValue
Source§impl Clone for ComponentValue
impl Clone for ComponentValue
Source§fn clone(&self) -> ComponentValue
fn clone(&self) -> ComponentValue
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 moreSource§impl Debug for ComponentValue
impl Debug for ComponentValue
Source§impl Display for ComponentValue
impl Display for ComponentValue
Source§impl FromStr for ComponentValue
impl FromStr for ComponentValue
Source§impl Hash for ComponentValue
impl Hash for ComponentValue
Source§impl Ord for ComponentValue
impl Ord for ComponentValue
Source§fn cmp(&self, other: &ComponentValue) -> Ordering
fn cmp(&self, other: &ComponentValue) -> 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 ComponentValue
impl PartialEq for ComponentValue
Source§fn eq(&self, other: &ComponentValue) -> bool
fn eq(&self, other: &ComponentValue) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ComponentValue
impl PartialOrd for ComponentValue
impl Eq for ComponentValue
impl StructuralPartialEq for ComponentValue
Auto Trait Implementations§
impl Freeze for ComponentValue
impl RefUnwindSafe for ComponentValue
impl Send for ComponentValue
impl Sync for ComponentValue
impl Unpin for ComponentValue
impl UnsafeUnpin for ComponentValue
impl UnwindSafe for ComponentValue
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