Struct Bot

Source
pub struct Bot { /* private fields */ }
Expand description

The Bot struct is used as a handle to send request to the Telegram Api

You may at any time refer to https://core.telegram.org/bots/api for the full documentation

Implementations§

Source§

impl Bot

Source

pub async fn get_me(&self) -> Result<User, Error>

A simple method for testing your bot’s authentication token. Requires no parameters. Returns basic information about the bot in form of a User object

Source

pub async fn log_out(&self) -> Result<bool, Error>

Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns true on success.

Source

pub async fn close(&self) -> Result<bool, Error>

Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn’t launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns true on success

Source

pub async fn send_message(&self, body: SendMessage) -> Result<Message, Error>

Use this method to send text messages. On success, the sent Message is returned.

Source

pub async fn forward_message( &self, body: ForwardMessage, ) -> Result<Message, Error>

Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

Source

pub async fn copy_message(&self, body: CopyMessage) -> Result<Message, Error>

Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz Poll can be copied only if the value of the field correct_option_id is known to the bot. The method is analogous to the method forward_message, but the copied message doesn't have a link to the original message. Returns the MessageIdof the sent message on success.

Source

pub async fn send_photo(&self, body: SendPhoto) -> Result<Message, Error>

Use this method to send photos. On success, the sent Message is returned.

Source

pub async fn send_audio(&self, body: SendAudio) -> Result<Message, Error>

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

For sending voice messages, use the send_invoice method instead.

Source

pub async fn send_document(&self, body: SendDocument) -> Result<Message, Error>

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

Source

pub async fn send_video(&self, body: SendVideo) -> Result<Message, Error>

Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

Source

pub async fn send_animation( &self, body: SendAnimation, ) -> Result<Message, Error>

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

Source

pub async fn send_voice(&self, body: SendVoice) -> Result<Message, Error>

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

Source

pub async fn send_video_note( &self, body: SendVideoNote, ) -> Result<Message, Error>

As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

Source

pub async fn send_media_group( &self, body: SendMediaGroup, ) -> Result<Vec<Message>, Error>

Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Message that were sent is returned.

Source

pub async fn send_location(&self, body: SendLocation) -> Result<Message, Error>

Use this method to send point on the map. On success, the sent Message is returned.

Source

pub async fn edit_message_live_location( &self, body: EditMessageLiveLocation, ) -> Result<Message, Error>

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stop_message_live_location. On success, if the edited message is not an inline message, the edited Message is returned, otherwise true is returned.

Source

pub async fn stop_message_live_location( &self, body: StopMessageLiveLocation, ) -> Result<Message, Error>

Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise true is returned.

Source

pub async fn send_venue(&self, body: SendVenue) -> Result<Message, Error>

Use this method to send information about a venue. On success, the sent Message is returned.

Source

pub async fn send_contact(&self, body: SendContact) -> Result<Message, Error>

Use this method to send phone contacts. On success, the sent Message is returned.

Source

pub async fn send_poll(&self, body: SendPoll) -> Result<Message, Error>

Use this method to send a native poll. On success, the sent Message is returned.

Source

pub async fn send_dice(&self, body: SendDice) -> Result<Message, Error>

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

Source

pub async fn send_chat_action( &self, body: SendChatAction, ) -> Result<Message, Error>

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns true on success.

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use send_chat_action with action = upload_photo. The user will see a “sending photo” status for the bot.

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

Source

pub async fn get_user_profile_photos( &self, body: GetUserProfilePhotos, ) -> Result<UserProfilePhotos, Error>

Use this method to get a list of profile pictures for a user. Returns aUserProfilePhotos object.

Source

pub async fn get_file(&self, body: GetFile) -> Result<File, Error>

Use this method to get basic information about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path>; is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling get_file again.

Source

pub async fn ban_chat_member(&self, body: BanChatMember) -> Result<bool, Error>

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn unban_chat_member( &self, body: UnbanChatMember, ) -> Result<bool, Error>

Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns true on success.

Source

pub async fn restrict_chat_member( &self, body: RestrictChatMember, ) -> Result<bool, Error>

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass true for all permissions to lift restrictions from a user. Returns true on success.

Source

pub async fn promote_chat_member( &self, body: PromoteChatMember, ) -> Result<bool, Error>

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns true on success.

Source

pub async fn set_chat_administrator_custom_title( &self, body: SetChatAdministratorCustomTitle, ) -> Result<bool, Error>

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns true on success.

Source

pub async fn ban_chat_sender_chat( &self, body: BanChatSenderChat, ) -> Result<bool, Error>

Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn unban_chat_sender_chat( &self, body: UnbanChatSenderChat, ) -> Result<bool, Error>

Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn set_chat_permissions( &self, body: SetChatPermissions, ) -> Result<bool, Error>

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns true on success.

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revoke_chat_invite_link. Returns the new invite link as ChatInviteLink object.

Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.

Source

pub async fn approve_chat_join_request( &self, body: ApproveChatJoinRequest, ) -> Result<bool, Error>

Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns true on success.

Source

pub async fn decline_chat_join_request( &self, body: DeclineChatJoinRequest, ) -> Result<bool, Error>

Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns true on success.

Source

pub async fn set_chat_photo(&self, body: SetChatPhoto) -> Result<bool, Error>

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn delete_chat_photo( &self, body: DeleteChatPhoto, ) -> Result<bool, Error>

Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn set_chat_title(&self, body: SetChatTitle) -> Result<bool, Error>

Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn set_chat_description( &self, body: SetChatDescription, ) -> Result<bool, Error>

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns true on success.

Source

pub async fn pin_chat_message( &self, body: PinChatMessage, ) -> Result<bool, Error>

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns true on success.

Source

pub async fn unpin_chat_message( &self, body: UnpinChatMessage, ) -> Result<bool, Error>

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns true on success.

Source

pub async fn unpin_all_chat_messages( &self, body: UnpinAllChatMessages, ) -> Result<bool, Error>

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns true on success.

Source

pub async fn leave_chat(&self, body: LeaveChat) -> Result<bool, Error>

Use this method for your bot to leave a group, supergroup or channel. Returns true on success.

Source

pub async fn get_chat(&self, body: GetChat) -> Result<Chat, Error>

Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

Source

pub async fn get_chat_administrators( &self, body: GetChatAdministrators, ) -> Result<Vec<ChatMember>, Error>

Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.

Source

pub async fn get_chat_member_count( &self, body: GetChatMemberCount, ) -> Result<i64, Error>

Use this method to get the number of members in a chat. Returns Int on success.

Source

pub async fn get_chat_member( &self, body: GetChatMember, ) -> Result<ChatMember, Error>

Use this method to get information about a member of a chat. Returns a ChatMember object on success.

Source

pub async fn set_chat_sticker_set( &self, body: SetChatStickerSet, ) -> Result<bool, Error>

Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in get_chat requests to check if the bot can use this method. Returns true on success.

Source

pub async fn delete_chat_sticker_set( &self, body: DeleteChatStickerSet, ) -> Result<bool, Error>

Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in get_chat requests to check if the bot can use this method. Returns true on success.

Source

pub async fn answer_callback_query( &self, body: AnswerCallbackQuery, ) -> Result<bool, Error>

Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, true is returned.

Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @BotFather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter

Source

pub async fn set_my_commands(&self, body: SetMyCommands) -> Result<bool, Error>

Use this method to change the list of the bot’s commands. See this manual for more details about bot commands. Returns true on success

Source

pub async fn delete_my_commands( &self, body: DeleteMyCommands, ) -> Result<bool, Error>

Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns true on success.

Source

pub async fn get_my_commands( &self, body: GetMyCommands, ) -> Result<Vec<BotCommand>, Error>

Use this method to get the current list of the bot's commands for the given scope and user language. Returns an Array of BotCommand objects. If commands aren't set, an empty list is returned.

Source

pub async fn set_chat_menu_button( &self, body: SetChatMenuButton, ) -> Result<bool, Error>

Use this method to change the bot's menu button in a private chat, or the default menu button. Returns true on success.

Source

pub async fn get_chat_menu_button( &self, body: GetChatMenuButton, ) -> Result<MenuButton, Error>

Use this method to get the current value of the bot's menu button in a private chat, or the default menu button. Returns MenuButton on success.

Source

pub async fn set_my_default_administrator_rights( &self, body: SetMyDefaultAdministratorRights, ) -> Result<bool, Error>

Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels. These rights will be suggested to users, but they are are free to modify the list before adding the bot. Returns true on success.

Source

pub async fn get_my_default_administrator_rights( &self, body: GetMyDefaultAdministratorRights, ) -> Result<ChatAdministratorRights, Error>

Use this method to get the current default administrator rights of the bot. Returns ChatAdministratorRights on success.

Source

pub async fn send_invoice(&self, body: SendInvoice) -> Result<Message, Error>

Use this method to send invoices. On success, the sent Message is returned.

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

Source

pub async fn answer_shipping_query( &self, body: AnswerShippingQuery, ) -> Result<bool, Error>

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, true is returned.

Source

pub async fn answer_pre_checkout_query( &self, body: AnswerPreCheckoutQuery, ) -> Result<bool, Error>

Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, true is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

Source

pub async fn set_password_data_errors( &self, body: SetPasswordDataErrors, ) -> Result<bool, Error>

Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns true on success.

Use this if the data submitted by the user doesn’t satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

Source

pub async fn send_game(&self, body: SendGame) -> Result<Message, Error>

Use this method to send a game. On success, the sent Message is returned.

Source

pub async fn set_game_score(&self, body: SetGameScore) -> Result<bool, Error>

Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise true is returned. Returns an error, if the new score is not greater than the user’s current score in the chat and force is False.

Source

pub async fn get_game_high_scores( &self, body: GetGameHighScores, ) -> Result<Vec<GameHighScore>, Error>

Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.

This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.

Source

pub async fn answer_inline_query( &self, body: AnswerInlineQuery, ) -> Result<Vec<bool>, Error>

Use this method to send answers to an inline query. On success, true is returned.

Source

pub async fn answer_webapp_query( &self, body: AnswerWebAppQuery, ) -> Result<Vec<SentWebAppMessage>, Error>

Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated. On success, a SentWebAppMessage object is returned.

Source

pub async fn create_forum_topic( &self, body: CreateForumTopic, ) -> Result<Message, Error>

Use this method to create a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns information about the created topic as a ForumTopic object.

Source

pub async fn edit_forum_topic( &self, body: EditForumTopic, ) -> Result<Message, Error>

Use this method to edit name and icon of a topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

Source

pub async fn close_forum_topic( &self, body: CloseForumTopic, ) -> Result<Message, Error>

Use this method to close an open topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

Source

pub async fn reopen_forum_topic( &self, body: ReopenForumTopic, ) -> Result<Message, Error>

Use this method to reopen a closed topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights, unless it is the creator of the topic. Returns True on success.

Source

pub async fn delete_forum_topic( &self, body: DeleteForumTopic, ) -> Result<Message, Error>

Use this method to delete a forum topic along with all its messages in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_delete_messages administrator rights. Returns True on success.

Source

pub async fn unpin_all_forum_topic_message( &self, body: UnpinAllForumTopicMessages, ) -> Result<Message, Error>

Use this method to clear the list of pinned messages in a forum topic. The bot must be an administrator in the chat for this to work and must have the can_pin_messages administrator right in the supergroup. Returns True on success.

Source

pub async fn edit_general_forum_topic( &self, body: EditGeneralForumTopic, ) -> Result<bool, Error>

Use this method to edit the name of the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have can_manage_topics administrator rights. Returns True on success.

Source

pub async fn close_general_forum_topic( &self, body: CloseGeneralForumTopic, ) -> Result<bool, Error>

Use this method to close an open ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.

Source

pub async fn reopen_general_forum_topic( &self, body: ReopenGeneralForumTopic, ) -> Result<bool, Error>

Use this method to reopen a closed ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically unhidden if it was hidden. Returns True on success.

Source

pub async fn hide_general_forum_topic( &self, body: HideGeneralForumTopic, ) -> Result<bool, Error>

Use this method to hide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. The topic will be automatically closed if it was open. Returns True on success.

Source

pub async fn unhide_general_forum_topic( &self, body: UnhideGeneralForumTopic, ) -> Result<bool, Error>

Use this method to unhide the ‘General’ topic in a forum supergroup chat. The bot must be an administrator in the chat for this to work and must have the can_manage_topics administrator rights. Returns True on success.

Trait Implementations§

Source§

impl Clone for Bot

Source§

fn clone(&self) -> Bot

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'r, T: Sync> FromUpdate<'r, T> for &'r Bot

Source§

fn from_update( bot: &'r Bot, _: &Update, _: Option<&BotState<T>>, ) -> Option<Self>

Instantiate Self from an incoming update

Auto Trait Implementations§

§

impl Freeze for Bot

§

impl !RefUnwindSafe for Bot

§

impl Send for Bot

§

impl Sync for Bot

§

impl Unpin for Bot

§

impl !UnwindSafe for Bot

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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,