Trait assembly_core::buffer::Buffer
source · [−]pub trait Buffer {
fn try_cast<T: MinimallyAligned>(&self, offset: u32) -> Result<&T, CastError>;
fn try_cast_slice<T: MinimallyAligned>(
&self,
offset: u32,
len: u32
) -> Result<&[T], CastError>;
fn cast<T: MinimallyAligned>(&self, offset: u32) -> &T;
fn cast_slice<T: MinimallyAligned>(&self, offset: u32, len: u32) -> &[T]ⓘNotable traits for &mut [u8]impl Write for &mut [u8]impl Read for &[u8]
;
}
Expand description
Additional methods on byte slices
Required Methods
sourcefn try_cast_slice<T: MinimallyAligned>(
&self,
offset: u32,
len: u32
) -> Result<&[T], CastError>
fn try_cast_slice<T: MinimallyAligned>(
&self,
offset: u32,
len: u32
) -> Result<&[T], CastError>
Try to cast to T
sourcefn cast<T: MinimallyAligned>(&self, offset: u32) -> &T
fn cast<T: MinimallyAligned>(&self, offset: u32) -> &T
Cast to T
Implementations on Foreign Types
sourceimpl Buffer for [u8]
impl Buffer for [u8]
sourcefn try_cast_slice<T: MinimallyAligned>(
&self,
offset: u32,
len: u32
) -> Result<&[T], CastError>
fn try_cast_slice<T: MinimallyAligned>(
&self,
offset: u32,
len: u32
) -> Result<&[T], CastError>
Try to cast to T
sourcefn cast<T: MinimallyAligned>(&self, offset: u32) -> &T
fn cast<T: MinimallyAligned>(&self, offset: u32) -> &T
Cast to T