pub unsafe trait BoundedParAccess<Index: Copy>: ParAccess<Index> {
// Required method
fn bounds(&self) -> Bounds<Index>;
// Provided methods
fn in_bounds(&self, index: Index) -> bool
where Index: RecordIndex { ... }
unsafe fn get_unsync(&self, index: Index) -> Self::Record
where Index: RecordIndex { ... }
}
Expand description
Unsynchronized access to a bounded collection.
This trait allows a data structure that is structurally similar to a multidimensional array
to describe its bounds, which enables use of the data structure with higher-level functionality
in paradis
.
§Safety
The bounds reported must be correct, in the sense that any index contained in the bounds may be used to access a valid record.
Required Methods§
Provided Methods§
Sourcefn in_bounds(&self, index: Index) -> boolwhere
Index: RecordIndex,
fn in_bounds(&self, index: Index) -> boolwhere
Index: RecordIndex,
Determine if the provided index is in bounds.
Can be overridden by implementors for a simpler implementation than the default, which may aid the compiler in eliding bounds checks in situations where bounds may not be eliminated upfront.
Sourceunsafe fn get_unsync(&self, index: Index) -> Self::Recordwhere
Index: RecordIndex,
unsafe fn get_unsync(&self, index: Index) -> Self::Recordwhere
Index: RecordIndex,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.