#[non_exhaustive]pub struct Layer {
pub id: String,
pub kinds: Vec<Kind>,
pub sampling: Box<dyn PositionSampling>,
pub overlay_mask_size_px: Option<(u32, u32)>,
pub overlay_brush_radius_px: Option<i32>,
pub selection_strategy: SelectionStrategy,
}Expand description
A layer in a scatter plan.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringUnique identifier for this layer.
kinds: Vec<Kind>Kinds to consider for placement in this layer.
sampling: Box<dyn PositionSampling>Sampling strategy to generate candidate positions.
overlay_mask_size_px: Option<(u32, u32)>Optional overlay mask size in pixels (width, height).
overlay_brush_radius_px: Option<i32>Optional overlay brush radius in pixels.
selection_strategy: SelectionStrategyStrategy for selecting a kind.
Implementations§
Source§impl Layer
impl Layer
Sourcepub fn new(
id: impl Into<String>,
kinds: Vec<Kind>,
sampling: Box<dyn PositionSampling>,
) -> Self
pub fn new( id: impl Into<String>, kinds: Vec<Kind>, sampling: Box<dyn PositionSampling>, ) -> Self
Create a new layer with required fields.
Sourcepub fn new_with<S: PositionSampling + 'static>(
id: impl Into<String>,
kinds: Vec<Kind>,
sampling: S,
) -> Self
pub fn new_with<S: PositionSampling + 'static>( id: impl Into<String>, kinds: Vec<Kind>, sampling: S, ) -> Self
Create a new layer with required fields and a concrete sampling strategy.
Sourcepub fn with_overlay(self, size: (u32, u32), radius: i32) -> Self
pub fn with_overlay(self, size: (u32, u32), radius: i32) -> Self
Set both optional overlay mask size in pixels (width, height) and brush radius in pixels.
Sourcepub fn with_selection_strategy(self, strategy: SelectionStrategy) -> Self
pub fn with_selection_strategy(self, strategy: SelectionStrategy) -> Self
Set the selection strategy for this layer.
Auto Trait Implementations§
impl !RefUnwindSafe for Layer
impl !UnwindSafe for Layer
impl Forget for Layer
impl Freeze for Layer
impl Send for Layer
impl Sync for Layer
impl Unpin for Layer
impl UnsafeUnpin 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