pub enum MediaSource<'a> {
Common(&'a MediaSource),
Sticker(&'a StickerMediaSource),
Uri(&'a OwnedMxcUri),
}
Expand description
The source of a media file.
Variants§
Common(&'a MediaSource)
A common media source.
Sticker(&'a StickerMediaSource)
The media source of a sticker.
Uri(&'a OwnedMxcUri)
An MXC URI.
Implementations§
Source§impl MediaSource<'_>
impl MediaSource<'_>
Sourcefn is_encrypted(&self) -> bool
fn is_encrypted(&self) -> bool
Whether this source is encrypted.
Sourcefn to_common_media_source(self) -> CommonMediaSource
fn to_common_media_source(self) -> CommonMediaSource
Get this source as a CommonMediaSource
.
Trait Implementations§
Source§impl<'a> Clone for MediaSource<'a>
impl<'a> Clone for MediaSource<'a>
Source§fn clone(&self) -> MediaSource<'a>
fn clone(&self) -> MediaSource<'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 MediaSource<'a>
impl<'a> Debug for MediaSource<'a>
Source§impl<'a> From<&'a MediaSource> for MediaSource<'a>
impl<'a> From<&'a MediaSource> for MediaSource<'a>
Source§fn from(value: &'a CommonMediaSource) -> Self
fn from(value: &'a CommonMediaSource) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a OwnedMxcUri> for MediaSource<'a>
impl<'a> From<&'a OwnedMxcUri> for MediaSource<'a>
Source§fn from(value: &'a OwnedMxcUri) -> Self
fn from(value: &'a OwnedMxcUri) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a StickerMediaSource> for MediaSource<'a>
impl<'a> From<&'a StickerMediaSource> for MediaSource<'a>
Source§fn from(value: &'a StickerMediaSource) -> Self
fn from(value: &'a StickerMediaSource) -> Self
Converts to this type from the input type.
impl<'a> Copy for MediaSource<'a>
Auto Trait Implementations§
impl<'a> Freeze for MediaSource<'a>
impl<'a> RefUnwindSafe for MediaSource<'a>
impl<'a> Send for MediaSource<'a>
impl<'a> Sync for MediaSource<'a>
impl<'a> Unpin for MediaSource<'a>
impl<'a> UnwindSafe for MediaSource<'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