On Mon Jun 2, 2025 at 5:53 PM JST, Abdiel Janulgue wrote:
Add unsafe accessors for the region for reading or writing large
blocks of data.
Reviewed-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@xxxxxxxxx>
A couple remaining nits/questions below, but FWIW:
Reviewed-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
+
+ /// Writes data to the region starting from `offset`. `offset` is in units of `T`, not the
+ /// number of bytes.
Reading this sentence it occured to me that `offset` may be ambiguous
here, as in my mind it rings as being in bytes unit. How about using
`index` throughout the file?
+ /// ```
+ pub unsafe fn write(&self, src: &[T], offset: usize) -> Result {
Can this function be written by leveraging `as_slice_mut` and
`clone_from_slice`?