Trait vsvg::DocumentTrait

source ·
pub trait DocumentTrait<L: LayerTrait<P, D>, P: PathTrait<D>, D: PathDataTrait>: Transforms {
Show 15 methods // Required methods fn layers(&self) -> &BTreeMap<LayerID, L>; fn layers_mut(&mut self) -> &mut BTreeMap<LayerID, L>; fn metadata(&self) -> &DocumentMetadata; fn metadata_mut(&mut self) -> &mut DocumentMetadata; // Provided methods fn push_path(&mut self, id: LayerID, path: impl Into<P>) { ... } fn try_get(&self, id: LayerID) -> Option<&L> { ... } fn get_mut(&mut self, id: LayerID) -> &mut L { ... } fn ensure_exists(&mut self, id: LayerID) { ... } fn for_each<F>(&mut self, f: F) where F: Fn(&mut L) { ... } fn merge_layers(&mut self) { ... } fn bounds(&self) -> Option<Rect> { ... } fn stats(&self) -> BTreeMap<LayerID, LayerStats> { ... } fn to_svg_string(&self) -> Result<String, Error> { ... } fn to_svg(&self, writer: impl Write) -> Result<()> { ... } fn to_svg_file(&self, file_path: impl AsRef<Path>) -> Result<()> { ... }
}

Required Methods§

source

fn layers(&self) -> &BTreeMap<LayerID, L>

source

fn layers_mut(&mut self) -> &mut BTreeMap<LayerID, L>

source

fn metadata(&self) -> &DocumentMetadata

source

fn metadata_mut(&mut self) -> &mut DocumentMetadata

Provided Methods§

source

fn push_path(&mut self, id: LayerID, path: impl Into<P>)

source

fn try_get(&self, id: LayerID) -> Option<&L>

source

fn get_mut(&mut self, id: LayerID) -> &mut L

source

fn ensure_exists(&mut self, id: LayerID)

source

fn for_each<F>(&mut self, f: F)
where F: Fn(&mut L),

source

fn merge_layers(&mut self)

Merge all existing layers into layer 0, if any.

source

fn bounds(&self) -> Option<Rect>

source

fn stats(&self) -> BTreeMap<LayerID, LayerStats>

source

fn to_svg_string(&self) -> Result<String, Error>

source

fn to_svg(&self, writer: impl Write) -> Result<()>

source

fn to_svg_file(&self, file_path: impl AsRef<Path>) -> Result<()>

Object Safety§

This trait is not object safe.

Implementors§