pub struct Layer {
pub shapes: Vec<Shape>,
pub sublayers: Vec<Layer>,
}Fields§
§shapes: Vec<Shape>§sublayers: Vec<Layer>Implementations§
Source§impl Layer
impl Layer
pub fn new() -> Self
pub fn new_from(shapes: Vec<Shape>) -> Self
pub fn new_from_shapes_and_layers( shapes: Vec<Shape>, sublayers: Vec<Layer>, ) -> Self
pub fn new_from_file(path: &PathBuf) -> Result<Layer>
pub fn new_from_binary(binary_data: &Vec<u8>) -> Result<Layer>
pub fn write_file(&self, path: &PathBuf) -> Result<()>
pub fn to_binary(&self) -> Result<Vec<u8>>
pub fn push(&mut self, shape: Shape)
pub fn push_path(&mut self, path: Path)
pub fn push_circle(&mut self, circle: Circle)
pub fn push_rect(&mut self, rect: Rect)
pub fn push_layer(&mut self, layer: Layer)
pub fn push_layer_flat(&mut self, layer: Layer)
pub fn iter(&self) -> Iter<'_, Shape>
pub fn iter_sublayers(&self) -> Iter<'_, Layer>
pub fn iter_flattened(&self) -> LayerFlattenedIterator<'_> ⓘ
pub fn len(&self) -> i32
pub fn is_empty(&self) -> bool
pub fn len_recursive(&self) -> i32
pub fn len_sublayers(&self) -> i32
pub fn to_svg(&self, scale: f32) -> Document
pub fn write_svg(&self, path: PathBuf, scale: f32) -> Result<()>
Trait Implementations§
Source§impl BoundingBox for Layer
impl BoundingBox for Layer
fn bounding_box(&self) -> Option<Rect>
Source§impl<'de> Deserialize<'de> for Layer
impl<'de> Deserialize<'de> for Layer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromIterator<Shape> for Layer
impl FromIterator<Shape> for Layer
Source§impl IntoIterator for Layer
impl IntoIterator for Layer
impl StructuralPartialEq for Layer
Auto Trait Implementations§
impl Freeze for Layer
impl RefUnwindSafe for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnwindSafe for Layer
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