pub enum ResizeTarget {
Exact {
width: u32,
height: u32,
},
Width {
width: u32,
},
}Expand description
How to resize the decoded source - see optimize’s own doc comment
for when each is used.
Variants§
Exact
The common case: <Image width="..." height="..." /> with both
given - resize to exactly this box, cropping/stretching as needed,
never preserving the source’s own aspect ratio. Laying out a fixed
box is the whole point of giving both dimensions explicitly.
Width
fill="true", or a sizes-driven srcset variant - only a target
width is known; height is derived from the source’s own aspect
ratio instead of being forced into an arbitrary box. Different
breakpoints/layouts legitimately want different heights for the
same source image, so forcing one fixed height across every
variant (the way ResizeTarget::Exact does for a single,
explicitly-boxed image) would be wrong here.
Trait Implementations§
Source§impl Clone for ResizeTarget
impl Clone for ResizeTarget
impl Copy for ResizeTarget
Source§impl Debug for ResizeTarget
impl Debug for ResizeTarget
impl Eq for ResizeTarget
Source§impl PartialEq for ResizeTarget
impl PartialEq for ResizeTarget
impl StructuralPartialEq for ResizeTarget
Auto Trait Implementations§
impl Forget for ResizeTarget
impl Freeze for ResizeTarget
impl Move for ResizeTarget
impl RefUnwindSafe for ResizeTarget
impl Send for ResizeTarget
impl Sync for ResizeTarget
impl Unpin for ResizeTarget
impl UnsafeUnpin for ResizeTarget
impl UnwindSafe for ResizeTarget
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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