pub struct Path(pub Vec<Data>);Expand description
A path is a set of commands
§Example
Out of the box, parsing and serializing a path will produce optimal formatting
use oxvg_path::{Path, parser::Parse as _};
let path = Path::parse_string("M 10 0.01 L 0.5 -1").unwrap();
assert_eq!(&path.to_string(), "M10 .01.5-1");For more extensive minification, look into using the run function.
Tuple Fields§
§0: Vec<Data>Implementations§
Source§impl<'input> Path
impl<'input> Path
Sourcepub fn parse_extend(
&mut self,
input: &mut Parser<'input>,
allow_implicit_start: bool,
) -> Result<(), ParseError<'input>>
pub fn parse_extend( &mut self, input: &mut Parser<'input>, allow_implicit_start: bool, ) -> Result<(), ParseError<'input>>
Trait Implementations§
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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<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