pub struct DataRef<'lt, Layout = Bytes> { /* private fields */ }Expand description
A buffer with layout, not aligned to any particular boundary.
Implementations§
Source§impl<'lt, L> DataRef<'lt, L>
impl<'lt, L> DataRef<'lt, L>
Sourcepub fn with_layout_at(data: &'lt [u8], layout: L, start: usize) -> Option<Self>where
L: Layout,
pub fn with_layout_at(data: &'lt [u8], layout: L, start: usize) -> Option<Self>where
L: Layout,
Construct from an explicit layout.
This wraps an underlying buffer which has image data of the indicated layout from its
start byte onwards.
Sourcepub fn as_source(&self) -> AsCopySource<'_, RangeEngine<L>>
pub fn as_source(&self) -> AsCopySource<'_, RangeEngine<L>>
An adapter reading from the data as one contiguous chunk.
See RangeEngine for more explanations.
Auto Trait Implementations§
impl<'lt, Layout> Freeze for DataRef<'lt, Layout>where
Layout: Freeze,
impl<'lt, Layout> RefUnwindSafe for DataRef<'lt, Layout>where
Layout: RefUnwindSafe,
impl<'lt, Layout> Send for DataRef<'lt, Layout>where
Layout: Send,
impl<'lt, Layout> Sync for DataRef<'lt, Layout>where
Layout: Sync,
impl<'lt, Layout> Unpin for DataRef<'lt, Layout>where
Layout: Unpin,
impl<'lt, Layout> UnsafeUnpin for DataRef<'lt, Layout>where
Layout: UnsafeUnpin,
impl<'lt, Layout> UnwindSafe for DataRef<'lt, Layout>where
Layout: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more