Struct usvg::AspectRatio
[−]
[src]
pub struct AspectRatio { pub defer: bool, pub align: Align, pub slice: bool, }
Representation of the preserveAspectRatio
attribute.
Examples
use std::str::FromStr; use svgtypes::AspectRatio; let ratio = AspectRatio::from_str("xMinYMax slice").unwrap(); assert_eq!(ratio.to_string(), "xMinYMax slice");
Fields
defer: bool
<defer>
value.
Set to true
when defer
value is present.
align: Align
<align>
value.
slice: bool
<meetOrSlice>
value.
- Set to
true
whenslice
value is present. - Set to
false
whenmeet
value is present or value is not set at all.
Trait Implementations
impl From<AspectRatio> for AttributeValue
[src]
fn from(value: AspectRatio) -> AttributeValue
[src]
Performs the conversion.
impl Display for AspectRatio
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl WriteBuffer for AspectRatio
[src]
fn write_buf_opt(&self, &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 AspectRatio
[src]
impl Copy for AspectRatio
[src]
impl FromStr for AspectRatio
[src]
type Err = Error
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<AspectRatio, <AspectRatio as FromStr>::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl PartialEq<AspectRatio> for AspectRatio
[src]
fn eq(&self, __arg_0: &AspectRatio) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &AspectRatio) -> bool
[src]
This method tests for !=
.
impl Clone for AspectRatio
[src]
fn clone(&self) -> AspectRatio
[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 AspectRatio
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more
impl Default for AspectRatio
[src]
fn default() -> AspectRatio
[src]
Returns the "default value" for a type. Read more