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