[][src]Struct mammut::media_builder::MediaBuilder

pub struct MediaBuilder {
    pub file: Cow<'static, str>,
    pub description: Option<Cow<'static, str>>,
    pub focus: Option<(f32, f32)>,
}

A builder pattern struct for constructing a media attachment.

Fields

file: Cow<'static, str>

The file name of the attachment to be uploaded.

description: Option<Cow<'static, str>>

The alt text of the attachment.

focus: Option<(f32, f32)>

The focus point for images.

Methods

impl MediaBuilder[src]

pub fn new(file: Cow<'static, str>) -> Self[src]

Create a new attachment from a file name.

pub fn description(self, description: Cow<'static, str>) -> Self[src]

Set an alt text description for the attachment.

pub fn focus(self, f1: f32, f2: f32) -> Self[src]

Set a focus point for an image attachment.

Trait Implementations

impl From<String> for MediaBuilder[src]

impl From<&'static str> for MediaBuilder[src]

impl From<Cow<'static, str>> for MediaBuilder[src]

impl Default for MediaBuilder[src]

impl Clone for MediaBuilder[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for MediaBuilder[src]

impl Serialize for MediaBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

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

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