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: u64Implementations§
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>
Auto Trait Implementations§
impl Freeze for ImageReadBuffer
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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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