pub struct Bot<C> { /* private fields */ }Expand description
A cheaply cloneable handle to initialized SimpleX bot.
Implementations§
Source§impl<C: ClientApi> Bot<C>
impl<C: ClientApi> Bot<C>
pub async fn init(client: C, settings: BotSettings) -> Result<Self, C::Error>
Sourcepub fn wrap_client<W, F>(self, wrap: F) -> Bot<W>
pub fn wrap_client<W, F>(self, wrap: F) -> Bot<W>
This method allows ot wrap or replace the underlying bot client.
You can define your own clients implementing the ClientApi trait and then you can
extend the bot functionalitty by implementing extension methods on Bot<YourCustomClient>
type.
Sourcepub fn default_profile(name: impl Into<String>) -> Profile
pub fn default_profile(name: impl Into<String>) -> Profile
Returns a minimal bot profile with conservative defaults: no files, calls, reactions, or voice.
Sourcepub async fn initiate_connection(
&self,
link: impl Into<String>,
) -> Result<UndocumentedResponse<ConnectResponse>, C::Error>
pub async fn initiate_connection( &self, link: impl Into<String>, ) -> Result<UndocumentedResponse<ConnectResponse>, C::Error>
Initiates the connection sequence.
-
If contact is already connected returns either UndocumentedResponse::Documented with ConnectResponse::ContactAlreadyExists or UndocumentedResponse::Undocumented with some other responses(this is an upstream mistake, SimpleX docs don’t list all possible responses for this method).
-
If contact is not connected returns UndocumentedResponse::Documented with one of the remaining ConnectResponse variants. The implementation must listen for crate::events::ContactConnected or crate::events::UserJoinedGroup to confirm the connection.
Sourcepub async fn check_connection_plan(
&self,
link: impl Into<String>,
) -> Result<Arc<ConnectionPlanResponse>, C::Error>
pub async fn check_connection_plan( &self, link: impl Into<String>, ) -> Result<Arc<ConnectionPlanResponse>, C::Error>
Inspect a SimpleX link before connecting: resolves its type (contact address, group link, or 1-time invitation) and reports whether the bot is already connected via it.
Sourcepub async fn create_invitation_link(
&self,
) -> Result<(String, Arc<PendingContactConnection>), C::Error>
pub async fn create_invitation_link( &self, ) -> Result<(String, Arc<PendingContactConnection>), C::Error>
Create one-time-invitation link. Can be used for admin-access or for private connections with other bots. The PendingContactConnection::pcc_conn_id can be matched with crate::types::Connection::conn_id to recognize the user connected by this link when handling the crate::events::ContactConnected event(see crate::events::ContactConnected::contact)
pub async fn create_address(&self) -> Result<String, C::Error>
Sourcepub async fn address(&self) -> Result<String, C::Error>
pub async fn address(&self) -> Result<String, C::Error>
Throws crate::types::errors::StoreError::UserContactLinkNotFound if bot doesn’t have an address. Use Self::get_or_create_address to ensure that address is available
pub async fn get_or_create_address(&self) -> Result<String, C::Error>
pub async fn configure_address( &self, settings: AddressSettings, ) -> Result<(), C::Error>
Sourcepub async fn publish_address(
&self,
) -> Result<Arc<UserProfileUpdatedResponse>, C::Error>
pub async fn publish_address( &self, ) -> Result<Arc<UserProfileUpdatedResponse>, C::Error>
Make address visible in bot/user profile
Sourcepub async fn hide_address(
&self,
) -> Result<Arc<UserProfileUpdatedResponse>, C::Error>
pub async fn hide_address( &self, ) -> Result<Arc<UserProfileUpdatedResponse>, C::Error>
Hide address from bot/user profile
pub async fn delete_address(&self) -> Result<(), C::Error>
Sourcepub async fn update_profile<F>(
&self,
updater: F,
) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn update_profile<F>( &self, updater: F, ) -> Result<ApiUpdateProfileResponse, C::Error>
Fetches the current profile and applies updater to it before saving.
pub async fn set_display_name( &self, name: impl Into<String>, ) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn set_full_name( &self, full_name: impl Into<String>, ) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn set_bio( &self, bio: impl Into<String>, ) -> Result<ApiUpdateProfileResponse, C::Error>
Sourcepub async fn set_avatar(
&self,
avatar: ImagePreview,
) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn set_avatar( &self, avatar: ImagePreview, ) -> Result<ApiUpdateProfileResponse, C::Error>
Set the bot/user avatar
Sourcepub async fn set_peer_type(
&self,
peer_type: ChatPeerType,
) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn set_peer_type( &self, peer_type: ChatPeerType, ) -> Result<ApiUpdateProfileResponse, C::Error>
Set account type Bot or Person
Sourcepub async fn set_preferences(
&self,
preferences: Preferences,
) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn set_preferences( &self, preferences: Preferences, ) -> Result<ApiUpdateProfileResponse, C::Error>
Set global preferences
Sourcepub async fn update_preferences<F>(
&self,
updater: F,
) -> Result<ApiUpdateProfileResponse, C::Error>
pub async fn update_preferences<F>( &self, updater: F, ) -> Result<ApiUpdateProfileResponse, C::Error>
Update global preferences via closure accepting current preferences
Sourcepub async fn set_contact_preferences<CID: Into<ContactId>>(
&self,
contact_id: CID,
preferences: Preferences,
) -> Result<Arc<ContactPrefsUpdatedResponse>, C::Error>
pub async fn set_contact_preferences<CID: Into<ContactId>>( &self, contact_id: CID, preferences: Preferences, ) -> Result<Arc<ContactPrefsUpdatedResponse>, C::Error>
Set preferences for particular contact
Sourcepub async fn tweak_preferences_for_contact<CID: Into<ContactId>, F>(
&self,
contact_id: CID,
updater: F,
) -> Result<Arc<ContactPrefsUpdatedResponse>, C::Error>
pub async fn tweak_preferences_for_contact<CID: Into<ContactId>, F>( &self, contact_id: CID, updater: F, ) -> Result<Arc<ContactPrefsUpdatedResponse>, C::Error>
Tweak global preferences for particular contact via closure accepting current global preferences
Sourcepub async fn contacts(&self) -> Result<Vec<Contact>, C::Error>
pub async fn contacts(&self) -> Result<Vec<Contact>, C::Error>
Get all contacts known to the bot(connected or not)
Sourcepub async fn accept_contact<CRID: Into<ContactRequestId>>(
&self,
contact_request_id: CRID,
) -> Result<Arc<AcceptingContactRequestResponse>, <C as ClientApi>::Error>
pub async fn accept_contact<CRID: Into<ContactRequestId>>( &self, contact_request_id: CRID, ) -> Result<Arc<AcceptingContactRequestResponse>, <C as ClientApi>::Error>
Accept contact request
Sourcepub async fn reject_contact<CRID: Into<ContactRequestId>>(
&self,
contact_request_id: CRID,
) -> Result<Arc<ContactRequestRejectedResponse>, <C as ClientApi>::Error>
pub async fn reject_contact<CRID: Into<ContactRequestId>>( &self, contact_request_id: CRID, ) -> Result<Arc<ContactRequestRejectedResponse>, <C as ClientApi>::Error>
Reject contact request
Sourcepub fn send_msg<CID: Into<ChatId>, M: MessageLike>(
&self,
chat_id: CID,
msg: M,
) -> MessageBuilder<'_, C, M::Kind>
pub fn send_msg<CID: Into<ChatId>, M: MessageLike>( &self, chat_id: CID, msg: M, ) -> MessageBuilder<'_, C, M::Kind>
Send a message. See the messages module for details
Sourcepub fn multicast<I, M>(
&self,
chat_ids: I,
msg: M,
) -> MulticastBuilder<'_, I, C, M::Kind>
pub fn multicast<I, M>( &self, chat_ids: I, msg: M, ) -> MulticastBuilder<'_, I, C, M::Kind>
Send the same message to multiple recepients
Sourcepub async fn chat_ids(&self) -> Result<impl Iterator<Item = ChatId>, C::Error>
pub async fn chat_ids(&self) -> Result<impl Iterator<Item = ChatId>, C::Error>
Returns a list of all known chat IDs
Sourcepub async fn chat_ids_with<F>(
&self,
f: F,
) -> Result<impl 'static + Send + Iterator<Item = ChatId>, C::Error>
pub async fn chat_ids_with<F>( &self, f: F, ) -> Result<impl 'static + Send + Iterator<Item = ChatId>, C::Error>
Returns a list of all known chat IDs matching the filter f.
Sourcepub async fn prepare_broadcast<M: MessageLike>(
&self,
msg: M,
) -> Result<MulticastBuilder<'_, impl 'static + Send + Iterator<Item = ChatId>, C, M::Kind>, C::Error>
pub async fn prepare_broadcast<M: MessageLike>( &self, msg: M, ) -> Result<MulticastBuilder<'_, impl 'static + Send + Iterator<Item = ChatId>, C, M::Kind>, C::Error>
Generate a MulticastBuilder that is ready to send messages to all known chats
bot.prepare_broadcast("Hey, what's up?!")
.await
.send()
.await?;Sourcepub async fn prepare_broadcast_with<M, F>(
&self,
msg: M,
f: F,
) -> Result<MulticastBuilder<'_, impl 'static + Send + Iterator<Item = ChatId>, C, M::Kind>, C::Error>
pub async fn prepare_broadcast_with<M, F>( &self, msg: M, f: F, ) -> Result<MulticastBuilder<'_, impl 'static + Send + Iterator<Item = ChatId>, C, M::Kind>, C::Error>
Generate a MulticastBuilder that is ready to send messages to chats matching the filter
bot.prepare_broadcast_with("What do you think about this logo?", |chat| chat.is_direct())
.await
.with_image(Image::new("logo.jpg"))
.send()
.await?;pub async fn update_msg<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, new_content: MsgContent, ) -> Result<ApiUpdateChatItemResponse, C::Error>
pub async fn delete_msg<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, mode: CIDeleteMode, ) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
pub async fn batch_delete_msgs<CID: Into<ChatId>, I: IntoIterator<Item = MessageId>>( &self, chat_id: CID, message_ids: I, mode: CIDeleteMode, ) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
Sourcepub async fn batch_msg_reactions<CID: Into<ChatId>, MID: Into<MessageId>, I: IntoIterator<Item = Reaction>>(
&self,
chat_id: CID,
message_id: MID,
reactions: I,
) -> Vec<Result<Arc<ChatItemReactionResponse>, C::Error>>
pub async fn batch_msg_reactions<CID: Into<ChatId>, MID: Into<MessageId>, I: IntoIterator<Item = Reaction>>( &self, chat_id: CID, message_id: MID, reactions: I, ) -> Vec<Result<Arc<ChatItemReactionResponse>, C::Error>>
Applies multiple reactions to a message. Returns one result per reaction.
pub async fn update_msg_reaction<CID: Into<ChatId>, MID: Into<MessageId>>( &self, chat_id: CID, message_id: MID, reaction: Reaction, ) -> Vec<Result<Arc<ChatItemReactionResponse>, C::Error>>
pub fn accept_file<FID: Into<FileId>>( &self, file_id: FID, ) -> AcceptFileBuilder<'_, C>
pub async fn reject_file<FID: Into<FileId>>( &self, file_id: FID, ) -> Result<CancelFileResponse, C::Error>
Sourcepub async fn delete_chat<CID: Into<ChatId>>(
&self,
chat_id: CID,
mode: DeleteMode,
) -> Result<ApiDeleteChatResponse, C::Error>
pub async fn delete_chat<CID: Into<ChatId>>( &self, chat_id: CID, mode: DeleteMode, ) -> Result<ApiDeleteChatResponse, C::Error>
Sourcepub async fn create_group(
&self,
profile: GroupProfile,
) -> Result<Arc<GroupCreatedResponse>, C::Error>
pub async fn create_group( &self, profile: GroupProfile, ) -> Result<Arc<GroupCreatedResponse>, C::Error>
Create a new group. The bot’s user becomes the owner.
Sourcepub async fn create_public_group<I: IntoIterator<Item = RelayId>>(
&self,
relay_ids: I,
profile: GroupProfile,
) -> Result<ApiNewPublicGroupResponse, C::Error>
pub async fn create_public_group<I: IntoIterator<Item = RelayId>>( &self, relay_ids: I, profile: GroupProfile, ) -> Result<ApiNewPublicGroupResponse, C::Error>
Create a new public group with relay members. The bot’s user becomes the owner.
Relay IDs can be obtained from Bot::get_group_relays
Sourcepub async fn set_auto_accept_member_contacts(
&self,
on: bool,
) -> Result<Arc<CmdOkResponse>, C::Error>
pub async fn set_auto_accept_member_contacts( &self, on: bool, ) -> Result<Arc<CmdOkResponse>, C::Error>
Enable or disable automatically accepting contacts from group members.
Sourcepub async fn add_member<GID: Into<GroupId>, CID: Into<ContactId>>(
&self,
group_id: GID,
contact_id: CID,
role: GroupMemberRole,
) -> Result<Arc<SentGroupInvitationResponse>, C::Error>
pub async fn add_member<GID: Into<GroupId>, CID: Into<ContactId>>( &self, group_id: GID, contact_id: CID, role: GroupMemberRole, ) -> Result<Arc<SentGroupInvitationResponse>, C::Error>
Sends a group invitation to a contact.
Sourcepub async fn join_group<GID: Into<GroupId>>(
&self,
group_id: GID,
) -> Result<Arc<UserAcceptedGroupSentResponse>, C::Error>
pub async fn join_group<GID: Into<GroupId>>( &self, group_id: GID, ) -> Result<Arc<UserAcceptedGroupSentResponse>, C::Error>
Accepts a pending group invitation.
Sourcepub async fn accept_member<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
role: GroupMemberRole,
) -> Result<Arc<MemberAcceptedResponse>, C::Error>
pub async fn accept_member<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, role: GroupMemberRole, ) -> Result<Arc<MemberAcceptedResponse>, C::Error>
Confirms a pending group membership request.
pub async fn set_members_role<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, role: GroupMemberRole, ) -> Result<Arc<MembersRoleUserResponse>, C::Error>
pub async fn set_member_role<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, role: GroupMemberRole, ) -> Result<Arc<MembersRoleUserResponse>, C::Error>
Sourcepub async fn block_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
pub async fn block_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
Blocks members so their messages are hidden for everyone in the group.
Sourcepub async fn unblock_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
pub async fn unblock_members_for_all<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
Reverses a previous block_members_for_all.
Sourcepub async fn block_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
pub async fn block_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
Blocks a member so their messages are hidden for everyone in the group.
Sourcepub async fn unblock_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
pub async fn unblock_member_for_all<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> Result<Arc<MembersBlockedForAllUserResponse>, C::Error>
Reverses a previous block_member_for_all.
Sourcepub async fn remove_members<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
pub async fn remove_members<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
Removes members from the group, preserving their past messages.
Sourcepub async fn remove_members_with_messages<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>(
&self,
group_id: GID,
member_ids: I,
) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
pub async fn remove_members_with_messages<GID: Into<GroupId>, I: IntoIterator<Item = MemberId>>( &self, group_id: GID, member_ids: I, ) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
Removes members from the group and deletes their messages.
Sourcepub async fn remove_member<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
pub async fn remove_member<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
Removes a member from the group, preserving their past messages.
Sourcepub async fn remove_member_with_messages<GID: Into<GroupId>, MID: Into<MemberId>>(
&self,
group_id: GID,
member_id: MID,
) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
pub async fn remove_member_with_messages<GID: Into<GroupId>, MID: Into<MemberId>>( &self, group_id: GID, member_id: MID, ) -> Result<Arc<UserDeletedMembersResponse>, C::Error>
Removes a member from the group and deletes their messages.
pub async fn leave_group<GID: Into<GroupId>>( &self, group_id: GID, ) -> Result<Arc<LeftMemberUserResponse>, C::Error>
pub async fn list_members<GID: Into<GroupId>>( &self, group_id: GID, ) -> Result<Vec<GroupMember>, C::Error>
Sourcepub async fn moderate_messages<GID: Into<GroupId>, I: IntoIterator<Item = MessageId>>(
&self,
group_id: GID,
message_ids: I,
) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
pub async fn moderate_messages<GID: Into<GroupId>, I: IntoIterator<Item = MessageId>>( &self, group_id: GID, message_ids: I, ) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
Deletes messages for all group members. Requires admin or owner role.
Sourcepub async fn moderate_message<GID: Into<GroupId>, MID: Into<MessageId>>(
&self,
group_id: GID,
message_id: MID,
) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
pub async fn moderate_message<GID: Into<GroupId>, MID: Into<MessageId>>( &self, group_id: GID, message_id: MID, ) -> Result<Arc<ChatItemsDeletedResponse>, C::Error>
Deletes a message for all group members. Requires admin or owner role.
pub async fn update_group_profile<GID: Into<GroupId>>( &self, group_id: GID, profile: GroupProfile, ) -> Result<Arc<GroupUpdatedResponse>, C::Error>
Sourcepub async fn set_group_custom_data<GID: Into<GroupId>>(
&self,
group_id: GID,
data: Option<JsonObject>,
) -> Result<Arc<CmdOkResponse>, C::Error>
pub async fn set_group_custom_data<GID: Into<GroupId>>( &self, group_id: GID, data: Option<JsonObject>, ) -> Result<Arc<CmdOkResponse>, C::Error>
Stores arbitrary app-defined JSON on the group. Pass None to clear it.
Sourcepub async fn set_contact_custom_data<CID: Into<ContactId>>(
&self,
contact_id: CID,
data: Option<JsonObject>,
) -> Result<Arc<CmdOkResponse>, C::Error>
pub async fn set_contact_custom_data<CID: Into<ContactId>>( &self, contact_id: CID, data: Option<JsonObject>, ) -> Result<Arc<CmdOkResponse>, C::Error>
Stores arbitrary app-defined JSON on the contact. Pass None to clear it.
pub async fn create_group_link<GID: Into<GroupId>>( &self, group_id: GID, role: GroupMemberRole, ) -> Result<Arc<GroupLinkCreatedResponse>, C::Error>
Sourcepub async fn set_group_link_role<GID: Into<GroupId>>(
&self,
group_id: GID,
role: GroupMemberRole,
) -> GroupLinkResult<C>
pub async fn set_group_link_role<GID: Into<GroupId>>( &self, group_id: GID, role: GroupMemberRole, ) -> GroupLinkResult<C>
Changes the default role assigned to members who join via the group link.
pub async fn delete_group_link<GID: Into<GroupId>>( &self, group_id: GID, ) -> Result<Arc<GroupLinkDeletedResponse>, C::Error>
pub async fn get_group_link<GID: Into<GroupId>>( &self, group_id: GID, ) -> GroupLinkResult<C>
pub async fn get_group_relays<GID: Into<GroupId>>( &self, group_id: GID, ) -> GetGroupRelaysResponse<C>
pub async fn add_group_relays<GID: Into<GroupId>, I: IntoIterator<Item = RelayId>>( &self, group_id: GID, relay_ids: I, ) -> AddGroupRelaysResponse<C>
pub async fn add_group_relay<GID: Into<GroupId>, RID: Into<RelayId>>( &self, group_id: GID, relay_id: RID, ) -> AddGroupRelaysResponse<C>
Sourcepub async fn get_chats(
&self,
pagination: PaginationByTime,
query: ChatListQuery,
) -> Result<Arc<ApiChatsResponse>, C::Error>
pub async fn get_chats( &self, pagination: PaginationByTime, query: ChatListQuery, ) -> Result<Arc<ApiChatsResponse>, C::Error>
Get chats with time-based pagination. Prefer this over Bot::contacts / Bot::groups
for large databases as it avoids loading all records into memory at once.
Source§impl<C: XftpExt> Bot<C>
impl<C: XftpExt> Bot<C>
pub fn download_file<FID: Into<FileId>>( &self, file_id: FID, ) -> DownloadFileBuilder<'_, C>
xftp only.Source§impl Bot<XftpClient<Client>>
impl Bot<XftpClient<Client>>
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Bot<C>where
C: Freeze,
impl<C> RefUnwindSafe for Bot<C>where
C: RefUnwindSafe,
impl<C> Send for Bot<C>where
C: Send,
impl<C> Sync for Bot<C>where
C: Sync,
impl<C> Unpin for Bot<C>where
C: Unpin,
impl<C> UnsafeUnpin for Bot<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Bot<C>where
C: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more