Struct image::image::ImageReadBuffer
source · pub(crate) struct ImageReadBuffer {
scanline_bytes: usize,
buffer: Vec<u8>,
consumed: usize,
total_bytes: u64,
offset: u64,
}
Fields§
§scanline_bytes: usize
§buffer: Vec<u8>
§consumed: usize
§total_bytes: u64
§offset: u64
Implementations§
source§impl ImageReadBuffer
impl ImageReadBuffer
sourcepub(crate) fn new(scanline_bytes: u64, total_bytes: u64) -> Self
pub(crate) fn new(scanline_bytes: u64, total_bytes: u64) -> Self
Create a new ImageReadBuffer.
Panics if scanline_bytes doesn’t fit into a usize, because that would mean reading anything from the image would take more RAM than the entire virtual address space. In other words, actually using this struct would instantly OOM so just get it out of the way now.
pub(crate) fn read<F>( &mut self, buf: &mut [u8], read_scanline: F ) -> Result<usize>where F: FnMut(&mut [u8]) -> Result<usize>,
Auto Trait Implementations§
impl RefUnwindSafe for ImageReadBuffer
impl Send for ImageReadBuffer
impl Sync for ImageReadBuffer
impl Unpin for ImageReadBuffer
impl UnwindSafe for ImageReadBuffer
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more