pub struct RocketChatAttachment {
pub title: Option<String>,
pub title_link: Option<String>,
pub color: Option<String>,
pub author_name: Option<String>,
pub author_icon: Option<String>,
pub text: Option<String>,
pub image_url: Option<String>,
pub fields: Vec<Field>,
}Expand description
A structure representing a rocket chat attachment
Fields§
§title: Option<String>Title of attachment
title_link: Option<String>Link for title of attachment
color: Option<String>Color on border left of attachment
Author name of attachment
Author icon of attachment (displayed only if author name is defined)
text: Option<String>Text of attachment
image_url: Option<String>Image of attachment
fields: Vec<Field>Fields of attachment
Implementations§
Source§impl RocketChatAttachment
impl RocketChatAttachment
Sourcepub fn set_title<S: Into<String>>(self, title: S) -> Self
pub fn set_title<S: Into<String>>(self, title: S) -> Self
Change the title of the attachment
let attachment = RocketChatAttachment::new().set_title("Title");Sourcepub fn set_title_link<S: Into<String>>(self, title_link: S) -> Self
pub fn set_title_link<S: Into<String>>(self, title_link: S) -> Self
Change the title link of attachment
let attachment = RocketChatAttachment::new().set_title_link("https://google.fr");Sourcepub fn set_color<S: Into<String>>(self, color: S) -> Self
pub fn set_color<S: Into<String>>(self, color: S) -> Self
Change the color of attachment
let attachment = RocketChatAttachment::new().set_color("#c97149");Change the author name & icon of attachment
let attachment = RocketChatAttachment::new().set_author("Author Name", Some("ICON_URL"));Sourcepub fn set_text<S: Into<String>>(self, text: S) -> Self
pub fn set_text<S: Into<String>>(self, text: S) -> Self
Change the content of attachment
let attachment = RocketChatAttachment::new().set_text("Text");Sourcepub fn set_image<S: Into<String>>(self, url: S) -> Self
pub fn set_image<S: Into<String>>(self, url: S) -> Self
Change the image of attachment
let attachment = RocketChatAttachment::new().set_image("IMAGE_URL");Sourcepub fn set_fields(self, fields: Vec<Field>) -> Self
pub fn set_fields(self, fields: Vec<Field>) -> Self
Change the fields of attachment
let attachment = RocketChatAttachment::new().set_fields(vec![Field::new()
.set_title("Field title")
.set_value("Field value")
.set_short(true)]);Trait Implementations§
Source§impl Default for RocketChatAttachment
impl Default for RocketChatAttachment
Source§fn default() -> RocketChatAttachment
fn default() -> RocketChatAttachment
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RocketChatAttachment
impl RefUnwindSafe for RocketChatAttachment
impl Send for RocketChatAttachment
impl Sync for RocketChatAttachment
impl Unpin for RocketChatAttachment
impl UnwindSafe for RocketChatAttachment
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