Struct rsvg::path_builder::PathBuilder
source · pub struct PathBuilder {
path_commands: TinyVec<[PathCommand; 32]>,
}
Expand description
Constructs a path out of commands.
Create this with PathBuilder::default
; you can then add commands to it or call the
parse
method. When you are finished constructing a path builder, turn it into a
Path
with into_path
. You can then iterate on that Path
’s commands with its
methods.
Fields§
§path_commands: TinyVec<[PathCommand; 32]>
Implementations§
source§impl PathBuilder
impl PathBuilder
pub fn parse(&mut self, path_str: &str) -> Result<(), ParseError>
sourcepub fn into_path(self) -> Path
pub fn into_path(self) -> Path
Consumes the PathBuilder
and returns a compact, immutable representation as a Path
.
sourcepub fn curve_to(&mut self, x2: f64, y2: f64, x3: f64, y3: f64, x4: f64, y4: f64)
pub fn curve_to(&mut self, x2: f64, y2: f64, x3: f64, y3: f64, x4: f64, y4: f64)
Adds a CurveTo command to the path.
sourcepub fn arc(
&mut self,
x1: f64,
y1: f64,
rx: f64,
ry: f64,
x_axis_rotation: f64,
large_arc: LargeArc,
sweep: Sweep,
x2: f64,
y2: f64
)
pub fn arc( &mut self, x1: f64, y1: f64, rx: f64, ry: f64, x_axis_rotation: f64, large_arc: LargeArc, sweep: Sweep, x2: f64, y2: f64 )
Adds an EllipticalArc command to the path.
sourcepub fn close_path(&mut self)
pub fn close_path(&mut self)
Adds a ClosePath command to the path.
Trait Implementations§
source§impl Default for PathBuilder
impl Default for PathBuilder
source§fn default() -> PathBuilder
fn default() -> PathBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnwindSafe for PathBuilder
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> 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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.