#[non_exhaustive]pub enum TransformWarning {
MetadataDropped(MetadataKind),
OrientationDropped {
orientation: u16,
},
TargetQualityNotReached {
target: TargetQuality,
achieved: f32,
quality: u8,
},
}Expand description
A non-fatal warning emitted during a transform operation.
Warnings indicate that the transform completed successfully but some aspect of the request could not be fully honored. Adapters should surface these to operators (e.g. CLI prints to stderr, server logs to stderr).
use truss::{MetadataKind, TransformWarning};
let warning = TransformWarning::MetadataDropped(MetadataKind::Xmp);
assert_eq!(
format!("{warning}"),
"XMP metadata was present in the input but could not be preserved by the output encoder"
);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MetadataDropped(MetadataKind)
Metadata of the given kind was present in the input but could not be preserved by the output encoder and was silently dropped.
OrientationDropped
The input carries an EXIF orientation that the output records neither in its pixels nor in its metadata, so the output displays rotated relative to the input.
TargetQualityNotReached
No quality the search probed reached the requested target, so the output scores below
it. Raised only for a target the caller named, never for the one auto picks on its
own, and never when the input’s own bytes were handed back. The search samples the
quality range rather than walking it, so this says no probed quality reached the
target rather than that none would; see TargetQuality.
Trait Implementations§
Source§impl Clone for TransformWarning
impl Clone for TransformWarning
Source§fn clone(&self) -> TransformWarning
fn clone(&self) -> TransformWarning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransformWarning
impl Debug for TransformWarning
Source§impl Display for TransformWarning
impl Display for TransformWarning
Source§impl PartialEq for TransformWarning
impl PartialEq for TransformWarning
impl StructuralPartialEq for TransformWarning
Auto Trait Implementations§
impl Freeze for TransformWarning
impl RefUnwindSafe for TransformWarning
impl Send for TransformWarning
impl Sync for TransformWarning
impl Unpin for TransformWarning
impl UnsafeUnpin for TransformWarning
impl UnwindSafe for TransformWarning
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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