pub struct AsCopySource<'lt, E> { /* private fields */ }Expand description
Borrows from a data source to read from it data into images.
The type parameter is the layout engine which defines the byte spans of data to be copied and
in doing so controls the overhead of the operation. Note that the type must implement a sealed
trait for all the main algorithms. The respective constructors on DataRef, DataMut,
DataCells choose this parameter.
Implementations§
Source§impl<'buf, E: LayoutEngine> AsCopySource<'buf, E>
impl<'buf, E: LayoutEngine> AsCopySource<'buf, E>
Sourcepub fn and_relocated(
self,
offset: AlignedOffset,
) -> AsCopySource<'buf, RelocateEngine<E>>where
E::Layout: Clone,
pub fn and_relocated(
self,
offset: AlignedOffset,
) -> AsCopySource<'buf, RelocateEngine<E>>where
E::Layout: Clone,
Offset the target location of this copy operation, to anther planar location.
Source§impl<E: LayoutEngine> AsCopySource<'_, E>
impl<E: LayoutEngine> AsCopySource<'_, E>
Sourcepub fn write_to_image(self, buffer: Image<Bytes>) -> Image<E::Layout>
pub fn write_to_image(self, buffer: Image<Bytes>) -> Image<E::Layout>
Write to an image, changing the layout in the process.
Reallocates the image buffer when necessary to ensure that the allocated buffer fits the new data’s layout.
Sourcepub fn write_to_mut<'data>(
self,
buffer: ImageMut<'data, Bytes>,
) -> Option<ImageMut<'data, E::Layout>>
pub fn write_to_mut<'data>( self, buffer: ImageMut<'data, Bytes>, ) -> Option<ImageMut<'data, E::Layout>>
Write to a mutable borrowed buffer with layout.
First verifies that the data will fit into the target. Then returns Some with a new
reference to the target buffer that is using the data’s layout. Otherwise, returns None.
Sourcepub fn write_to_cell_image(
self,
buffer: CellImage<Bytes>,
) -> Option<CellImage<E::Layout>>
pub fn write_to_cell_image( self, buffer: CellImage<Bytes>, ) -> Option<CellImage<E::Layout>>
Write to an image, changing the layout in the process.
Fails when allocated buffer does not fits the new data’s layout.
Sourcepub fn write_to_cell_ref<'data>(
self,
buffer: CellImageRef<'data, Bytes>,
) -> Option<CellImageRef<'data, E::Layout>>
pub fn write_to_cell_ref<'data>( self, buffer: CellImageRef<'data, Bytes>, ) -> Option<CellImageRef<'data, E::Layout>>
Write to a locally shared buffer with layout.
First verifies that the data will fit into the target. Then returns Some with a new
reference to the target buffer that is using the data’s layout. Otherwise, returns None.
Sourcepub fn write_to_atomic_image(
self,
buffer: AtomicImage<Bytes>,
) -> Option<AtomicImage<E::Layout>>
pub fn write_to_atomic_image( self, buffer: AtomicImage<Bytes>, ) -> Option<AtomicImage<E::Layout>>
Write to an image, changing the layout in the process.
Fails when allocated buffer does not fits the new data’s layout.
Sourcepub fn write_to_atomic_ref<'data>(
self,
buffer: AtomicImageRef<'data, Bytes>,
) -> Option<AtomicImageRef<'data, E::Layout>>
pub fn write_to_atomic_ref<'data>( self, buffer: AtomicImageRef<'data, Bytes>, ) -> Option<AtomicImageRef<'data, E::Layout>>
Write to a mutable borrowed buffer with layout.
First verifies that the data will fit into the target. Then returns Some with a new
reference to the target buffer that is using the data’s layout. Otherwise, returns None.