Struct svgdom::Length
[−]
[src]
pub struct Length { pub num: f64, pub unit: LengthUnit, }
Representation of the <length>
type.
Fields
num: f64
unit: LengthUnit
Methods
impl Length
[src]
pub fn new(num: f64, unit: LengthUnit) -> Length
[src]
Constructs a new length.
pub fn new_number(num: f64) -> Length
[src]
Constructs a new length with LengthUnit::None
.
pub fn zero() -> Length
[src]
Constructs a new length with a zero number.
Shorthand for: Length::new(0.0, Unit::None)
.
Trait Implementations
impl Display for Length
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl WriteBuffer for Length
[src]
fn write_buf_opt(&self, opt: &WriteOptions, buf: &mut Vec<u8>)
[src]
Writes data to the Vec<u8>
buffer using specified WriteOptions
.
fn write_buf(&self, buf: &mut Vec<u8>)
[src]
Writes data to the Vec<u8>
buffer using default WriteOptions
.
fn with_write_opt(&'a self, opt: &'a WriteOptions) -> DisplaySvg<'a, Self>
[src]
Returns an object that implements fmt::Display
using provided write options.
impl FromSpan for Length
[src]
fn from_span(span: StrSpan) -> Result<Length, <Length as FromStr>::Err>
[src]
Parses data from a StrSpan
.
impl FuzzyEq<Length> for Length
[src]
fn fuzzy_eq(&self, other: &Length) -> bool
[src]
Returns true
if values are approximately equal.
fn fuzzy_ne(&self, other: &Rhs) -> bool
[src]
Returns true
if values are not approximately equal.
impl Copy for Length
[src]
impl FromStr for Length
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Length, <Length as FromStr>::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl PartialEq<Length> for Length
[src]
fn eq(&self, __arg_0: &Length) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Length) -> bool
[src]
This method tests for !=
.
impl Clone for Length
[src]
fn clone(&self) -> Length
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Length
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more