pub struct ComposerAttachment { /* private fields */ }Expand description
One validated, path-free image retained in local composer state.
Implementations§
Source§impl ComposerAttachment
impl ComposerAttachment
Sourcepub fn inline(
mime_type: &str,
data: impl Into<String>,
display_name: impl AsRef<Path>,
) -> Result<Self, AttachmentError>
pub fn inline( mime_type: &str, data: impl Into<String>, display_name: impl AsRef<Path>, ) -> Result<Self, AttachmentError>
Builds an attachment from a standard padded Base64 image payload.
§Errors
Returns AttachmentError when the MIME type is unsupported or the
payload violates the protocol image contract.
Sourcepub const fn content(&self) -> &ContentBlock
pub const fn content(&self) -> &ContentBlock
Returns the canonical protocol content block.
Sourcepub fn display_name(&self) -> &str
pub fn display_name(&self) -> &str
Returns the bounded path-free display name.
Sourcepub const fn decoded_bytes(&self) -> usize
pub const fn decoded_bytes(&self) -> usize
Returns the decoded payload size in bytes.
Sourcepub const fn encoded_bytes(&self) -> usize
pub const fn encoded_bytes(&self) -> usize
Returns the encoded payload size in bytes.
Trait Implementations§
Source§impl Clone for ComposerAttachment
impl Clone for ComposerAttachment
Source§impl Debug for ComposerAttachment
impl Debug for ComposerAttachment
Source§impl PartialEq for ComposerAttachment
impl PartialEq for ComposerAttachment
impl StructuralPartialEq for ComposerAttachment
Auto Trait Implementations§
impl Freeze for ComposerAttachment
impl RefUnwindSafe for ComposerAttachment
impl Send for ComposerAttachment
impl Sync for ComposerAttachment
impl Unpin for ComposerAttachment
impl UnsafeUnpin for ComposerAttachment
impl UnwindSafe for ComposerAttachment
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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