Struct matrix_sdk::attachment::AttachmentConfig
source · pub struct AttachmentConfig { /* private fields */ }
Expand description
Configuration for sending an attachment.
Implementations§
source§impl AttachmentConfig
impl AttachmentConfig
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new default AttachmentConfig
without providing a thumbnail.
To provide a thumbnail use AttachmentConfig::with_thumbnail()
.
sourcepub fn with_thumbnail(thumbnail: Thumbnail) -> Self
pub fn with_thumbnail(thumbnail: Thumbnail) -> Self
Create a new default AttachmentConfig
with a thumbnail
.
§Arguments
thumbnail
- The thumbnail of the media. If thecontent_type
does not support it (eg audio clips), it is ignored.
sourcepub fn txn_id(self, txn_id: &TransactionId) -> Self
pub fn txn_id(self, txn_id: &TransactionId) -> Self
Set the transaction ID to send.
§Arguments
txn_id
- A unique ID that can be attached to aMessageEvent
held in its unsigned field astransaction_id
. If not given, one is created for the message.
sourcepub fn info(self, info: AttachmentInfo) -> Self
pub fn info(self, info: AttachmentInfo) -> Self
Set the media metadata to send.
§Arguments
info
- The metadata of the media. If theAttachmentInfo
type doesn’t match thecontent_type
, it is ignored.
Trait Implementations§
source§impl Debug for AttachmentConfig
impl Debug for AttachmentConfig
source§impl Default for AttachmentConfig
impl Default for AttachmentConfig
source§fn default() -> AttachmentConfig
fn default() -> AttachmentConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AttachmentConfig
impl RefUnwindSafe for AttachmentConfig
impl Send for AttachmentConfig
impl Sync for AttachmentConfig
impl Unpin for AttachmentConfig
impl UnwindSafe for AttachmentConfig
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<>
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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