pub enum ComponentKind {
Resistor,
Capacitor,
Inductor,
Diode,
Transistor,
IntegratedCircuit,
Connector,
Switch,
Sensor,
PowerSupply,
Unknown,
Custom(String),
}Expand description
A small electronic component classification vocabulary.
Variants§
Resistor
Capacitor
Inductor
Diode
Transistor
IntegratedCircuit
Connector
Switch
Sensor
PowerSupply
Unknown
Custom(String)
Implementations§
Source§impl ComponentKind
impl ComponentKind
Sourcepub fn custom(value: impl AsRef<str>) -> Result<Self, ComponentKindParseError>
pub fn custom(value: impl AsRef<str>) -> Result<Self, ComponentKindParseError>
Creates a custom component kind from non-empty text.
§Errors
Returns ComponentKindParseError::Empty when the trimmed value is empty.
Trait Implementations§
Source§impl Clone for ComponentKind
impl Clone for ComponentKind
Source§fn clone(&self) -> ComponentKind
fn clone(&self) -> ComponentKind
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 ComponentKind
impl Debug for ComponentKind
Source§impl Display for ComponentKind
impl Display for ComponentKind
Source§impl FromStr for ComponentKind
impl FromStr for ComponentKind
Source§impl Hash for ComponentKind
impl Hash for ComponentKind
Source§impl Ord for ComponentKind
impl Ord for ComponentKind
Source§fn cmp(&self, other: &ComponentKind) -> Ordering
fn cmp(&self, other: &ComponentKind) -> 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 ComponentKind
impl PartialEq for ComponentKind
Source§fn eq(&self, other: &ComponentKind) -> bool
fn eq(&self, other: &ComponentKind) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ComponentKind
impl PartialOrd for ComponentKind
impl Eq for ComponentKind
impl StructuralPartialEq for ComponentKind
Auto Trait Implementations§
impl Freeze for ComponentKind
impl RefUnwindSafe for ComponentKind
impl Send for ComponentKind
impl Sync for ComponentKind
impl Unpin for ComponentKind
impl UnsafeUnpin for ComponentKind
impl UnwindSafe for ComponentKind
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