[][src]Struct af_slack::Attachment

pub struct Attachment<'a> {
    pub blocks: Vec<Block<'a>>,
    pub color: Cow<'a, str>,
}

A message attachment.

Fields

blocks: Vec<Block<'a>>

A list of content blocks.

color: Cow<'a, str>

The color of the attachment.

Implementations

impl<'a> Attachment<'a>[src]

pub const fn new() -> Self[src]

Creates a new, blank attachment with the default color.

pub const fn debug() -> Self[src]

Creates a new, blank attachment with a “debug” color.

pub const fn info() -> Self[src]

Creates a new, blank attachment with an “info” color.

pub const fn warn() -> Self[src]

Creates a new, blank attachment with a “warn” color.

pub const fn error() -> Self[src]

Creates a new, blank attachment with an “error” color.

pub const fn success() -> Self[src]

Creates a new, blank attachment with a “success” color.

pub fn add_block(&mut self, block: impl Into<Block<'a>>) -> &mut Self[src]

Adds a block to the attachment.

pub fn set_color(&mut self, color: impl Into<Cow<'a, str>>) -> &mut Self[src]

Sets the color of the attachment.

pub fn with_block(mut self: Self, block: impl Into<Block<'a>>) -> Self[src]

Adds a block to the attachment.

pub fn with_color(mut self: Self, color: impl Into<Cow<'a, str>>) -> Self[src]

Sets the color of the attachment.

Trait Implementations

impl<'a> Debug for Attachment<'a>[src]

impl<'a> Default for Attachment<'a>[src]

impl<'a> From<Attachment<'a>> for Message<'a>[src]

impl<'a> Serialize for Attachment<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Attachment<'a>[src]

impl<'a> Send for Attachment<'a>[src]

impl<'a> Sync for Attachment<'a>[src]

impl<'a> Unpin for Attachment<'a>[src]

impl<'a> UnwindSafe for Attachment<'a>[src]

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,