pub struct LayeredField { /* private fields */ }Expand description
Deterministic row-major field of layered cells.
Implementations§
Source§impl LayeredField
impl LayeredField
Sourcepub fn with_config(
config: &FieldConfig,
) -> Result<LayeredField, LayeredFieldError>
pub fn with_config( config: &FieldConfig, ) -> Result<LayeredField, LayeredFieldError>
Allocate an empty field from a validated configuration.
Sourcepub fn empty(
width: usize,
height: usize,
) -> Result<LayeredField, LayeredFieldError>
pub fn empty( width: usize, height: usize, ) -> Result<LayeredField, LayeredFieldError>
Allocate an empty field with explicit dimensions.
Sourcepub const fn dimensions(&self) -> (usize, usize)
pub const fn dimensions(&self) -> (usize, usize)
Cell dimensions.
Sourcepub fn cell_count(&self) -> usize
pub fn cell_count(&self) -> usize
Number of cells in row-major storage.
Sourcepub fn linear_index(&self, x: usize, y: usize) -> Option<usize>
pub fn linear_index(&self, x: usize, y: usize) -> Option<usize>
Row-major address for (x, y), or None when outside the field.
Sourcepub fn cells(&self) -> &[LayeredCell]
pub fn cells(&self) -> &[LayeredCell]
Cells in row-major order.
Sourcepub const fn evidence(&self) -> FieldEvidence
pub const fn evidence(&self) -> FieldEvidence
Structured sampling facts.
Sourcepub fn from_cells(
width: usize,
height: usize,
cells: Vec<LayeredCell>,
evidence: FieldEvidence,
) -> Result<LayeredField, LayeredFieldError>
pub fn from_cells( width: usize, height: usize, cells: Vec<LayeredCell>, evidence: FieldEvidence, ) -> Result<LayeredField, LayeredFieldError>
Build a field from a complete row-major cell buffer and sampling evidence.
The constructor rejects empty, overflowing, or length-mismatched storage; callers cannot construct a partially initialized field.
Sourcepub fn derive_occupancy(
&self,
tolerance: Tolerance,
) -> Result<LayeredField, LayeredFieldError>
pub fn derive_occupancy( &self, tolerance: Tolerance, ) -> Result<LayeredField, LayeredFieldError>
Derive occupancy spans in every cell from its crossing sequence.
Requires closed, consistently wound input: an unbalanced column is reported rather than repaired.
Trait Implementations§
Source§impl Clone for LayeredField
impl Clone for LayeredField
Source§fn clone(&self) -> LayeredField
fn clone(&self) -> LayeredField
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LayeredField
impl Debug for LayeredField
Source§impl PartialEq for LayeredField
impl PartialEq for LayeredField
impl StructuralPartialEq for LayeredField
Auto Trait Implementations§
impl Freeze for LayeredField
impl RefUnwindSafe for LayeredField
impl Send for LayeredField
impl Sync for LayeredField
impl Unpin for LayeredField
impl UnwindSafe for LayeredField
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