pub struct ImageSource<'a> {
pub source: MediaSource<'a>,
pub 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<'a> ImageSource<'a>
impl<'a> ImageSource<'a>
sourcefn should_thumbnail(
&self,
prefer_thumbnail: bool,
thumbnail_dimensions: ImageDimensions,
) -> bool
fn should_thumbnail( &self, prefer_thumbnail: bool, thumbnail_dimensions: ImageDimensions, ) -> 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<ImageDimensions>
fn dimensions(&self) -> Option<ImageDimensions>
The dimensions of this source.
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 copy 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> 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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