pub trait AsNeSlice {
// Required methods
fn as_ne_u16_slice(&self) -> &[u16];
fn as_mut_ne_u16_slice(&mut self) -> &mut [u16];
fn as_ne_u32_slice(&self) -> &[u32];
fn as_mut_ne_u32_slice(&mut self) -> &mut [u32];
fn as_ne_u64_slice(&self) -> &[u64];
fn as_mut_ne_u64_slice(&mut self) -> &mut [u64];
}
Expand description
Trait for types which can be viewed as native-endian integer slices This should generally just be, aligned slices of dumb bytes or similar. (Indeed the only intended implementor is Aligned<A8, GenericArray<u8, N>>)
This should only be implemented when all the bytes in the underlying object can be accessed this way. So, the number of bytes should be divisible by 8 and aligned to an 8 byte boundary.
TODO: This could be 3 traits instead, one for each integer type, but we didn’t need that yet.
Required Methods§
Sourcefn as_ne_u16_slice(&self) -> &[u16]
fn as_ne_u16_slice(&self) -> &[u16]
Represent the value as native-endian u16’s
Sourcefn as_mut_ne_u16_slice(&mut self) -> &mut [u16]
fn as_mut_ne_u16_slice(&mut self) -> &mut [u16]
Represent the value as mutable native-endian u16’s
Sourcefn as_ne_u32_slice(&self) -> &[u32]
fn as_ne_u32_slice(&self) -> &[u32]
Represent the value as native-endian u32’s
Sourcefn as_mut_ne_u32_slice(&mut self) -> &mut [u32]
fn as_mut_ne_u32_slice(&mut self) -> &mut [u32]
Represent the value as mutable native-endian u32’s
Sourcefn as_ne_u64_slice(&self) -> &[u64]
fn as_ne_u64_slice(&self) -> &[u64]
Represent the value as native-endian u64’s
Sourcefn as_mut_ne_u64_slice(&mut self) -> &mut [u64]
fn as_mut_ne_u64_slice(&mut self) -> &mut [u64]
Represent the value as mutable native-endian u64’s