pub enum Unit {
Mil,
Millimeter,
Inch,
Centimeter,
DxpDefault,
Meter,
}Expand description
Measurement units supported by Altium.
Variants§
Mil
Mils (thousandths of an inch).
Millimeter
Millimeters.
Inch
Inches.
Centimeter
Centimeters.
DxpDefault
DXP default units (10 mils).
Meter
Meters.
Implementations§
Source§impl Unit
impl Unit
Sourcepub fn from_coord(self, coord: Coord) -> f64
pub fn from_coord(self, coord: Coord) -> f64
Converts a Coord to a value in this unit.
Sourcepub fn parse_with_unit(s: &str) -> Result<(Coord, Unit)>
pub fn parse_with_unit(s: &str) -> Result<(Coord, Unit)>
Parses a string with a unit suffix and returns the coordinate and unit.
Examples: “100mil”, “2.54mm”, “1in”
Sourcepub fn format_coord(self, coord: Coord) -> String
pub fn format_coord(self, coord: Coord) -> String
Formats a coordinate with this unit.
Trait Implementations§
impl Copy for Unit
impl Eq for Unit
impl StructuralPartialEq for Unit
Auto Trait Implementations§
impl Freeze for Unit
impl RefUnwindSafe for Unit
impl Send for Unit
impl Sync for Unit
impl Unpin for Unit
impl UnwindSafe for Unit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more