pub struct Agent { /* private fields */ }Implementations§
Source§impl Agent
impl Agent
pub fn new( client: TokioXmppClient, config: Config, disco: DiscoInfoResult, ) -> Agent
Sourcepub async fn set_config(&mut self, config: Config)
pub async fn set_config(&mut self, config: Config)
Reset the agent configuration to the provided Config struct
pub async fn get_config(&self) -> Config
pub async fn disconnect(self) -> Result<(), Error>
pub async fn send_stanza<S: Into<Stanza>>( &mut self, st: S, ) -> Result<StanzaToken, Error>
Available on crate feature
escape-hatch only.pub async fn join_room<'a>(&mut self, settings: JoinRoomSettings<'a>)
Sourcepub async fn leave_room<'a>(&mut self, settings: LeaveRoomSettings<'a>)
pub async fn leave_room<'a>(&mut self, settings: LeaveRoomSettings<'a>)
Request to leave a chatroom.
If successful, an Event::RoomLeft event will be produced. This method does not remove the room from bookmarks nor remove the autojoin flag. See muc::room::leave_room for more information.
pub async fn send_raw_message<'a>(&mut self, settings: RawMessageSettings<'a>)
pub async fn send_message<'a>(&mut self, settings: MessageSettings<'a>)
pub async fn send_room_message<'a>(&mut self, settings: RoomMessageSettings<'a>)
pub async fn send_room_private_message<'a>( &mut self, settings: RoomPrivateMessageSettings<'a>, )
Sourcepub async fn wait_for_events(&mut self) -> Vec<Event>
pub async fn wait_for_events(&mut self) -> Vec<Event>
Wait for new events, or Error::Disconnected when connection is closed and will not reconnect.
pub async fn upload_file_with(&mut self, service: &str, path: &Path)
Auto Trait Implementations§
impl Freeze for Agent
impl !RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
impl !UnwindSafe for Agent
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