pub struct Layer {
pub object_sizes: ObjectSizes,
pub objects: HashMap<String, ColoredObject>,
pub name: String,
pub hidden: bool,
pub _render_cache: Option<Group>,
}
Fields§
§object_sizes: ObjectSizes
§objects: HashMap<String, ColoredObject>
§name: String
§_render_cache: Option<Group>
Implementations§
Source§impl Layer
impl Layer
pub fn new(name: &str) -> Self
pub fn hide(&mut self)
pub fn show(&mut self)
pub fn toggle(&mut self)
pub fn object(&mut self, name: &str) -> &mut ColoredObject
pub fn safe_object(&mut self, name: &str) -> Option<&mut ColoredObject>
pub fn flush(&mut self)
pub fn clear(&mut self)
pub fn replace(&mut self, with: Layer)
pub fn remove_all_objects_in(&mut self, region: &Region)
pub fn paint_all_objects(&mut self, fill: Fill)
pub fn filter_all_objects(&mut self, filter: Filter)
pub fn move_all_objects(&mut self, dx: i32, dy: i32)
pub fn add_object<N: Display>(&mut self, name: N, object: ColoredObject)
pub fn set_object<N: Display>(&mut self, name: N, object: ColoredObject)
pub fn filter_object( &mut self, name: &str, filter: Filter, ) -> Result<(), String>
pub fn remove_object(&mut self, name: &str)
pub fn replace_object(&mut self, name: &str, object: ColoredObject)
Trait Implementations§
Source§impl SVGRenderable for Layer
impl SVGRenderable for Layer
fn render_to_svg( &self, colormap: ColorMapping, cell_size: usize, object_sizes: ObjectSizes, id: &str, ) -> Result<Element>
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