pub struct ArrayFlags {
pub c_contiguous: bool,
pub f_contiguous: bool,
pub owndata: bool,
pub writeable: bool,
pub aligned: bool,
}Expand description
Flags describing the memory properties of an array.
Mirrors NumPy’s arr.flags field: a flat collection of independent
boolean memory-layout properties. The names map 1:1 to NumPy and are
accessed individually by callers, so a bitfield-style enum would
hurt ergonomics rather than help.
Fields§
§c_contiguous: boolWhether the data is C-contiguous (row-major).
f_contiguous: boolWhether the data is Fortran-contiguous (column-major).
owndata: boolWhether the array owns its data.
writeable: boolWhether the array is writeable.
aligned: boolWhether the underlying data pointer is properly aligned for the element type (#345). Mirrors numpy’s NPY_ARRAY_ALIGNED flag.
Owned arrays produced through ferray’s safe constructors are
always aligned because they go through Vec<T> which the
allocator guarantees to align for T. Views constructed via
from_shape_ptr from a raw pointer can be misaligned and
will report aligned = false here so callers can detect the
degenerate case before passing into a SIMD path.
Trait Implementations§
Source§impl Clone for ArrayFlags
impl Clone for ArrayFlags
Source§fn clone(&self) -> ArrayFlags
fn clone(&self) -> ArrayFlags
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more