Struct DingTalkMessage

Source
pub struct DingTalkMessage {
Show 17 fields pub message_type: DingTalkMessageType, pub text_content: String, pub markdown_title: String, pub markdown_content: String, pub link_text: String, pub link_title: String, pub link_pic_url: String, pub link_message_url: String, pub action_card_title: String, pub action_card_text: String, pub action_card_hide_avatar: DingTalkMessageActionCardHideAvatar, pub action_card_btn_orientation: DingTalkMessageActionCardBtnOrientation, pub action_card_single_btn: Option<DingTalkMessageActionCardBtn>, pub action_card_btns: Vec<DingTalkMessageActionCardBtn>, pub feed_card_links: Vec<DingTalkMessageFeedCardLink>, pub at_all: bool, pub at_mobiles: Vec<String>,
}
Expand description

DingTalk message

Fields§

§message_type: DingTalkMessageType§text_content: String§markdown_title: String§markdown_content: String§link_text: String§link_title: String§link_pic_url: String§link_message_url: String§action_card_title: String§action_card_text: String§action_card_hide_avatar: DingTalkMessageActionCardHideAvatar§action_card_btn_orientation: DingTalkMessageActionCardBtnOrientation§action_card_single_btn: Option<DingTalkMessageActionCardBtn>§action_card_btns: Vec<DingTalkMessageActionCardBtn>§feed_card_links: Vec<DingTalkMessageFeedCardLink>§at_all: bool§at_mobiles: Vec<String>

Implementations§

Source§

impl DingTalkMessage

Source

pub fn new_text(text_content: &str) -> Self

New text DingTalk message

Source

pub fn new_markdown(markdown_title: &str, markdown_content: &str) -> Self

New markdown DingTalk message

New link DingTalk message

Source

pub fn new_action_card(title: &str, text: &str) -> Self

New action card DingTalk message

Source

pub fn new_feed_card() -> Self

New feed card DingTalk message

Source

pub fn new(message_type: DingTalkMessageType) -> Self

New DingTalk message

Source

pub fn text(self, text_content: &str) -> Self

Set text

Source

pub fn markdown(self, markdown_title: &str, markdown_content: &str) -> Self

Set markdown

Set link

Source

pub fn action_card_show_avatar(self) -> Self

Set action card show avator(default show)

Source

pub fn action_card_hide_avatar(self) -> Self

Set action card hide avator

Source

pub fn action_card_btn_vertical(self) -> Self

Set action card btn vertical(default vertical)

Source

pub fn action_card_btn_landscape(self) -> Self

Set action card btn landscape

Source

pub fn set_action_card_signle_btn( self, btn: DingTalkMessageActionCardBtn, ) -> Self

Set action card single btn

Source

pub fn add_action_card_btn(self, btn: DingTalkMessageActionCardBtn) -> Self

Add action card btn

Add feed card link

Add feed card link detail

Source

pub fn at_all(self) -> Self

At all

Source

pub fn at_mobiles(self, mobiles: &[String]) -> Self

At mobiles

Trait Implementations§

Source§

impl Debug for DingTalkMessage

Source§

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

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

impl Default for DingTalkMessage

Source§

fn default() -> DingTalkMessage

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

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T