pub struct TransformOptions {
pub width: Option<u32>,
pub height: Option<u32>,
pub fit: Option<Fit>,
pub position: Option<Position>,
pub format: Option<MediaType>,
pub quality: Option<u8>,
pub background: Option<Rgba8>,
pub rotate: Rotation,
pub auto_orient: bool,
pub strip_metadata: bool,
pub preserve_exif: bool,
pub deadline: Option<Duration>,
}Expand description
Raw transform options before defaulting and validation has completed.
Fields§
§width: Option<u32>The desired output width in pixels.
height: Option<u32>The desired output height in pixels.
fit: Option<Fit>The requested resize fit mode.
position: Option<Position>The requested positioning mode.
format: Option<MediaType>The requested output format.
quality: Option<u8>The requested lossy quality.
background: Option<Rgba8>The requested background color.
rotate: RotationThe requested extra rotation.
auto_orient: boolWhether EXIF-based auto-orientation should run.
strip_metadata: boolWhether metadata should be stripped from the output.
preserve_exif: boolWhether EXIF metadata should be preserved.
deadline: Option<Duration>Optional wall-clock deadline for the transform pipeline.
When set, the transform checks elapsed time at each pipeline stage and returns
TransformError::LimitExceeded if the deadline is exceeded. Adapters inject
this value based on their operational requirements — for example, the HTTP server
sets a 30-second deadline while the CLI leaves it as None (unlimited).
Implementations§
Source§impl TransformOptions
impl TransformOptions
Sourcepub fn normalize(
self,
input_media_type: MediaType,
) -> Result<NormalizedTransformOptions, TransformError>
pub fn normalize( self, input_media_type: MediaType, ) -> Result<NormalizedTransformOptions, TransformError>
Normalizes and validates the options against the input media type.
Trait Implementations§
Source§impl Clone for TransformOptions
impl Clone for TransformOptions
Source§fn clone(&self) -> TransformOptions
fn clone(&self) -> TransformOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransformOptions
impl Debug for TransformOptions
Source§impl Default for TransformOptions
impl Default for TransformOptions
Source§impl PartialEq for TransformOptions
impl PartialEq for TransformOptions
impl Eq for TransformOptions
impl StructuralPartialEq for TransformOptions
Auto Trait Implementations§
impl Freeze for TransformOptions
impl RefUnwindSafe for TransformOptions
impl Send for TransformOptions
impl Sync for TransformOptions
impl Unpin for TransformOptions
impl UnsafeUnpin for TransformOptions
impl UnwindSafe for TransformOptions
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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