pub enum PreparedJpeg<'a> {
Borrowed(&'a [u8]),
Owned(Vec<u8>),
}Expand description
Prepared JPEG bytes, borrowed when unchanged and owned when normalized.
Variants§
Borrowed(&'a [u8])
Original tile bytes can be decoded directly.
Owned(Vec<u8>)
Preparation changed the byte stream.
Implementations§
Source§impl PreparedJpeg<'_>
impl PreparedJpeg<'_>
Sourcepub fn try_clone(&self) -> Result<Self, JpegError>
pub fn try_clone(&self) -> Result<Self, JpegError>
Fallibly duplicate this prepared JPEG.
Borrowed inputs remain borrowed without allocation. Owned normalized payloads are copied through the same typed, capped allocation contract used by dimension rewrite and TIFF assembly.
§Errors
Returns JpegError::MemoryCapExceeded when the owned payload exceeds
the JPEG host cap, or JpegError::HostAllocationFailed when a
cap-valid copy cannot be reserved.
Trait Implementations§
Source§impl AsRef<[u8]> for PreparedJpeg<'_>
impl AsRef<[u8]> for PreparedJpeg<'_>
Source§impl<'a> Debug for PreparedJpeg<'a>
impl<'a> Debug for PreparedJpeg<'a>
impl<'a> Eq for PreparedJpeg<'a>
Source§impl<'a> PartialEq for PreparedJpeg<'a>
impl<'a> PartialEq for PreparedJpeg<'a>
impl<'a> StructuralPartialEq for PreparedJpeg<'a>
Auto Trait Implementations§
impl<'a> Freeze for PreparedJpeg<'a>
impl<'a> RefUnwindSafe for PreparedJpeg<'a>
impl<'a> Send for PreparedJpeg<'a>
impl<'a> Sync for PreparedJpeg<'a>
impl<'a> Unpin for PreparedJpeg<'a>
impl<'a> UnsafeUnpin for PreparedJpeg<'a>
impl<'a> UnwindSafe for PreparedJpeg<'a>
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