pub struct Component {
pub base: Name,
pub transform: AffineTransform,
/* private fields */
}
Expand description
A reference to another glyph, to be included in this glyph’s outline.
Fields§
§base: Name
The name of the base glyph used in the component.
transform: AffineTransform
Component affine transormation definition.
Implementations§
source§impl Component
impl Component
sourcepub fn new(
base: Name,
transform: AffineTransform,
identifier: Option<Identifier>,
lib: Option<Plist>
) -> Self
pub fn new( base: Name, transform: AffineTransform, identifier: Option<Identifier>, lib: Option<Plist> ) -> Self
Returns a new Component
given a base glyph name and affine transformation definition.
The ‘name’ argument should be taken from an existing glyph in the same layer.
sourcepub fn lib_mut(&mut self) -> Option<&mut Plist>
pub fn lib_mut(&mut self) -> Option<&mut Plist>
Returns a mutable reference to the component’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 component, leaving a None in its place.
sourcepub fn identifier(&self) -> Option<&Identifier>
pub fn identifier(&self) -> Option<&Identifier>
Returns a reference to the component’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 Component
impl PartialEq for Component
impl StructuralPartialEq for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnwindSafe for Component
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