pub(crate) struct ImageSource<'a> {
pub(crate) source: MediaSource<'a>,
pub(crate) info: Option<ImageSourceInfo<'a>>,
}Expand description
The source of an image.
Fields§
§source: MediaSource<'a>The source of the image.
info: Option<ImageSourceInfo<'a>>Information about the image.
Implementations§
Source§impl ImageSource<'_>
impl ImageSource<'_>
Sourcefn should_thumbnail(
&self,
prefer_thumbnail: bool,
prefer_animated: bool,
thumbnail_dimensions: FrameDimensions,
) -> bool
fn should_thumbnail( &self, prefer_thumbnail: bool, prefer_animated: bool, thumbnail_dimensions: FrameDimensions, ) -> bool
Whether we should try to thumbnail this source for the given requested dimensions.
Sourcefn can_be_thumbnailed(&self) -> bool
fn can_be_thumbnailed(&self) -> bool
Whether this source can be thumbnailed by the media repo.
Returns false in these cases:
- The image is encrypted, because it is not possible for the media repo to make a thumbnail.
- The image uses the SVG format, because media repos usually do not accept to create a thumbnail of those.
Sourcefn dimensions(&self) -> Option<FrameDimensions>
fn dimensions(&self) -> Option<FrameDimensions>
The dimensions of this source.
Sourcefn is_animated(&self) -> bool
fn is_animated(&self) -> bool
Whether this source is animated.
Returns false if the info does not say that it is animated, or if the
MIME type is not one of the supported animated image formats.
Trait Implementations§
Source§impl<'a> Clone for ImageSource<'a>
impl<'a> Clone for ImageSource<'a>
Source§fn clone(&self) -> ImageSource<'a>
fn clone(&self) -> ImageSource<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ImageSource<'a>
impl<'a> Debug for ImageSource<'a>
impl<'a> Copy for ImageSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for ImageSource<'a>
impl<'a> RefUnwindSafe for ImageSource<'a>
impl<'a> Send for ImageSource<'a>
impl<'a> Sync for ImageSource<'a>
impl<'a> Unpin for ImageSource<'a>
impl<'a> UnsafeUnpin for ImageSource<'a>
impl<'a> UnwindSafe for ImageSource<'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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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>
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