pub struct Attachment {
Show 15 fields pub id: Option<Id>, pub extension: Option<Vec<Extension>>, pub content_type: Option<CodeDt>, pub language: Option<CodeDt>, pub data: Option<Base64BinaryDt>, pub url: Option<UrlDt>, pub size: Option<Integer64Dt>, pub hash: Option<Base64BinaryDt>, pub title: Option<StringDt>, pub creation: Option<DateTimeDt>, pub height: Option<PositiveIntDt>, pub width: Option<PositiveIntDt>, pub frames: Option<PositiveIntDt>, pub duration: Option<DecimalDt>, pub pages: Option<PositiveIntDt>,
}

Fields§

§id: Option<Id>

Unique id for inter-element referencing

§extension: Option<Vec<Extension>>

Additional content defined by implementations

§content_type: Option<CodeDt>

Mime type of the content, with charset etc.

§language: Option<CodeDt>

Human language of the content (BCP-47)

§data: Option<Base64BinaryDt>

Data inline, base64ed

§url: Option<UrlDt>

Uri where the data can be found

§size: Option<Integer64Dt>

Number of bytes of content (if url provided)

§hash: Option<Base64BinaryDt>

Hash of the data (sha-1, base64ed)

§title: Option<StringDt>

Label to display in place of the data

§creation: Option<DateTimeDt>

Date attachment was first created

§height: Option<PositiveIntDt>

Height of the image in pixels (photo/video)

§width: Option<PositiveIntDt>

Width of the image in pixels (photo/video)

§frames: Option<PositiveIntDt>

Number of frames if > 1 (photo)

§duration: Option<DecimalDt>

Length in seconds (audio / video)

§pages: Option<PositiveIntDt>

Number of printed pages

Implementations§

source§

impl Attachment

source

pub fn set_content_type<T: Into<CodeDt>>(self, v: T) -> Self

source

pub fn set_language<T: Into<CodeDt>>(self, v: T) -> Self

source

pub fn set_data<T: Into<Base64BinaryDt>>(self, v: T) -> Self

source

pub fn set_url<T: Into<UrlDt>>(self, v: T) -> Self

source

pub fn set_size<T: Into<Integer64Dt>>(self, v: T) -> Self

source

pub fn set_hash<T: Into<Base64BinaryDt>>(self, v: T) -> Self

source

pub fn set_title<T: Into<StringDt>>(self, v: T) -> Self

source

pub fn set_creation<T: Into<DateTimeDt>>(self, v: T) -> Self

source

pub fn set_height<T: Into<PositiveIntDt>>(self, v: T) -> Self

source

pub fn set_width<T: Into<PositiveIntDt>>(self, v: T) -> Self

source

pub fn set_frames<T: Into<PositiveIntDt>>(self, v: T) -> Self

source

pub fn set_duration<T: Into<DecimalDt>>(self, v: T) -> Self

source

pub fn set_pages<T: Into<PositiveIntDt>>(self, v: T) -> Self

Trait Implementations§

source§

impl Clone for Attachment

source§

fn clone(&self) -> Attachment

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Attachment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Attachment

source§

fn default() -> Attachment

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Attachment

source§

fn deserialize<De>(deserializer: De) -> Result<Self>
where De: Deserializer<'de>,

source§

impl Element for Attachment

source§

fn has_id(&self) -> bool

source§

fn id(&self) -> &Option<String>

source§

fn set_id<T: Into<String>>(self, id: T) -> Self

source§

fn has_extension(&self) -> bool

source§

fn extension(&self) -> &Option<Vec<Extension>>

source§

fn set_extension(self, ext: Vec<Extension>) -> Self

source§

fn add_extension(self, ext: Extension) -> Self

source§

impl Serialize for Attachment

source§

fn serialize<Ser: Serializer>(&self, serializer: Ser) -> Result<()>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more