pub struct Defaults { /* private fields */ }Expand description
Convenience struct to gather all parameters with a (user defined) default value.
Fields that are None indicate “no default was set” and will not be injected into API
calls.
Implementations§
Source§impl Defaults
impl Defaults
Sourcepub fn builder() -> DefaultsBuilder
pub fn builder() -> DefaultsBuilder
Returns a new DefaultsBuilder for ergonomic construction.
§Example
let defaults = Defaults::builder()
.parse_mode("HTML")
.protect_content(true)
.build();Sourcepub fn parse_mode(&self) -> Option<&str>
pub fn parse_mode(&self) -> Option<&str>
Send Markdown or HTML – if you want Telegram apps to show bold, italic, fixed-width text or URLs in your bot’s message.
Sourcepub fn explanation_parse_mode(&self) -> Option<&str>
pub fn explanation_parse_mode(&self) -> Option<&str>
Alias for parse_mode, used for the corresponding parameter of
Bot::send_poll.
Sourcepub fn text_parse_mode(&self) -> Option<&str>
pub fn text_parse_mode(&self) -> Option<&str>
Alias for parse_mode, used for InputPollOption and
Bot::send_gift.
Sourcepub fn question_parse_mode(&self) -> Option<&str>
pub fn question_parse_mode(&self) -> Option<&str>
Alias for parse_mode, used for Bot::send_poll.
Sourcepub fn quote_parse_mode(&self) -> Option<&str>
pub fn quote_parse_mode(&self) -> Option<&str>
Alias for parse_mode, used for ReplyParameters.
Sourcepub fn disable_notification(&self) -> Option<bool>
pub fn disable_notification(&self) -> Option<bool>
Sends the message silently.
Sourcepub fn allow_sending_without_reply(&self) -> Option<bool>
pub fn allow_sending_without_reply(&self) -> Option<bool>
Pass true if the message should be sent even if the specified replied-to message is not
found.
Sourcepub fn protect_content(&self) -> Option<bool>
pub fn protect_content(&self) -> Option<bool>
Protects the contents of the sent message from forwarding and saving.
Sourcepub fn link_preview_options(&self) -> Option<&LinkPreviewOptions>
pub fn link_preview_options(&self) -> Option<&LinkPreviewOptions>
Link preview generation options for all outgoing messages.
Sourcepub fn api_defaults(&self) -> &HashMap<String, Value>
pub fn api_defaults(&self) -> &HashMap<String, Value>
Pre-computed mapping of non-None defaults keyed by API parameter name.