pub struct PathData { /* private fields */ }Expand description
Compact SVG path d data, eliding repeated commands and separators the grammar does not need.
Implementations§
Source§impl PathData
impl PathData
Sourcepub fn parse(text: &str) -> (Vec<PathCommand>, bool)
pub fn parse(text: &str) -> (Vec<PathCommand>, bool)
Path commands up to the first error and whether all parsed, normalized as Blink’s
SVGPathNormalizer.
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
An empty path with room for capacity bytes.
Sourcepub fn command(&mut self, letter: u8)
pub fn command(&mut self, letter: u8)
Writes a command letter unless the grammar lets it repeat implicitly. Pairs after a moveto are linetos, so a second moveto keeps its letter.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
The path data written so far.
Auto Trait Implementations§
impl Forget for PathData
impl Freeze for PathData
impl Move for PathData
impl RefUnwindSafe for PathData
impl Send for PathData
impl Sync for PathData
impl Unpin for PathData
impl UnsafeUnpin for PathData
impl UnwindSafe for PathData
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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