Struct ruma::events::image::ThumbnailFileContentBlock
source · pub struct ThumbnailFileContentBlock {
pub url: OwnedMxcUri,
pub mimetype: String,
pub name: Option<String>,
pub size: Option<UInt>,
pub encryption_info: Option<Box<EncryptedContent>>,
}
Available on crate features
events
and unstable-msc3552
only.Expand description
A block for thumbnail file content.
Fields§
§url: OwnedMxcUri
The URL to the thumbnail.
mimetype: String
The mimetype of the file, e.g. “image/png”.
name: Option<String>
The original filename of the uploaded file.
size: Option<UInt>
The size of the file in bytes.
encryption_info: Option<Box<EncryptedContent>>
Information on the encrypted thumbnail.
Required if the thumbnail is encrypted.
Implementations§
source§impl ThumbnailFileContentBlock
impl ThumbnailFileContentBlock
sourcepub fn plain(url: OwnedMxcUri, mimetype: String) -> ThumbnailFileContentBlock
pub fn plain(url: OwnedMxcUri, mimetype: String) -> ThumbnailFileContentBlock
Creates a new non-encrypted ThumbnailFileContentBlock
with the given url and mimetype.
sourcepub fn encrypted(
url: OwnedMxcUri,
mimetype: String,
encryption_info: EncryptedContent,
) -> ThumbnailFileContentBlock
pub fn encrypted( url: OwnedMxcUri, mimetype: String, encryption_info: EncryptedContent, ) -> ThumbnailFileContentBlock
Creates a new encrypted ThumbnailFileContentBlock
with the given url, mimetype and
encryption info.
sourcepub fn is_encrypted(&self) -> bool
pub fn is_encrypted(&self) -> bool
Whether the thumbnail file is encrypted.
Trait Implementations§
source§impl Clone for ThumbnailFileContentBlock
impl Clone for ThumbnailFileContentBlock
source§fn clone(&self) -> ThumbnailFileContentBlock
fn clone(&self) -> ThumbnailFileContentBlock
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 Debug for ThumbnailFileContentBlock
impl Debug for ThumbnailFileContentBlock
source§impl<'de> Deserialize<'de> for ThumbnailFileContentBlock
impl<'de> Deserialize<'de> for ThumbnailFileContentBlock
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThumbnailFileContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ThumbnailFileContentBlock, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for ThumbnailFileContentBlock
impl Serialize for ThumbnailFileContentBlock
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for ThumbnailFileContentBlock
impl RefUnwindSafe for ThumbnailFileContentBlock
impl Send for ThumbnailFileContentBlock
impl Sync for ThumbnailFileContentBlock
impl Unpin for ThumbnailFileContentBlock
impl UnwindSafe for ThumbnailFileContentBlock
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§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