pub struct Contour {
pub points: Vec<ContourPoint>,
/* private fields */
}
Expand description
A single open or closed bezier path segment.
Fields§
§points: Vec<ContourPoint>
A collection of contour points.
Implementations§
source§impl Contour
impl Contour
sourcepub fn to_kurbo(&self) -> Result<BezPath, ConvertContourError>
pub fn to_kurbo(&self) -> Result<BezPath, ConvertContourError>
Converts the Contour
to a kurbo::BezPath
.
source§impl Contour
impl Contour
sourcepub fn new(
points: Vec<ContourPoint>,
identifier: Option<Identifier>,
lib: Option<Plist>
) -> Self
pub fn new( points: Vec<ContourPoint>, identifier: Option<Identifier>, lib: Option<Plist> ) -> Self
Returns a new Contour
given a vector of contour points.
sourcepub fn lib_mut(&mut self) -> Option<&mut Plist>
pub fn lib_mut(&mut self) -> Option<&mut Plist>
Returns a mutable reference to the contour’s lib.
sourcepub fn replace_lib(&mut self, lib: Plist) -> Option<Plist>
pub fn replace_lib(&mut self, lib: Plist) -> Option<Plist>
Replaces the actual lib by the lib given in parameter, returning the old lib if present. Sets a new UUID v4 identifier if none is set already.
sourcepub fn take_lib(&mut self) -> Option<Plist>
pub fn take_lib(&mut self) -> Option<Plist>
Takes the lib out of the contour, leaving a None in its place.
sourcepub fn identifier(&self) -> Option<&Identifier>
pub fn identifier(&self) -> Option<&Identifier>
Returns a reference to the contour’s identifier.
sourcepub fn replace_identifier(&mut self, id: Identifier) -> Option<Identifier>
pub fn replace_identifier(&mut self, id: Identifier) -> Option<Identifier>
Replaces the actual identifier by the identifier given in parameter, returning the old identifier if present.
Trait Implementations§
source§impl PartialEq for Contour
impl PartialEq for Contour
impl StructuralPartialEq for Contour
Auto Trait Implementations§
impl Freeze for Contour
impl RefUnwindSafe for Contour
impl Send for Contour
impl Sync for Contour
impl Unpin for Contour
impl UnwindSafe for Contour
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