pub struct ProjectionLayout {
pub entries: Vec<(ProjectionId, usize)>,
pub stride: usize,
}Expand description
A frozen memory layout: which projections are active, at what offsets.
Fields§
§entries: Vec<(ProjectionId, usize)>Active projections with their byte offsets, in order.
stride: usizeTotal bytes per atom (sum of all projection byte sizes).
Implementations§
Source§impl ProjectionLayout
impl ProjectionLayout
Sourcepub fn from_projections(ids: &[ProjectionId]) -> Self
pub fn from_projections(ids: &[ProjectionId]) -> Self
Create a layout from a set of projection IDs. Order is canonical (Splat, Kuramoto, Expert, Graph) regardless of input order.
Sourcepub fn offset_of(&self, id: ProjectionId) -> Option<usize>
pub fn offset_of(&self, id: ProjectionId) -> Option<usize>
Get byte offset for a projection, or None if not in layout.
Sourcepub fn has(&self, id: ProjectionId) -> bool
pub fn has(&self, id: ProjectionId) -> bool
Whether a projection is active in this layout.
Trait Implementations§
Source§impl Clone for ProjectionLayout
impl Clone for ProjectionLayout
Source§fn clone(&self) -> ProjectionLayout
fn clone(&self) -> ProjectionLayout
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for ProjectionLayout
impl RefUnwindSafe for ProjectionLayout
impl Send for ProjectionLayout
impl Sync for ProjectionLayout
impl Unpin for ProjectionLayout
impl UnsafeUnpin for ProjectionLayout
impl UnwindSafe for ProjectionLayout
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