[−][src]Struct matrix_bot_api::MatrixBot
Methods
impl MatrixBot
[src]
pub fn new<M>(handler: M) -> MatrixBot where
M: MessageHandler + 'static + Send,
[src]
M: MessageHandler + 'static + Send,
Consumes any struct that implements the MessageHandler-trait.
pub fn get_activebot_clone(&self) -> ActiveBot
[src]
Create a copy of the internal ActiveBot instance for sending messages
pub fn add_handler<M>(&mut self, handler: M) where
M: MessageHandler + 'static + Send,
[src]
M: MessageHandler + 'static + Send,
Add an additional handler. Each message will be given to all registered handlers until one of them returns "HandleResult::StopHandling".
pub fn set_verbose(&mut self, verbose: bool)
[src]
If true, will print all Matrix-message coming in and going out (quite verbose!) to stdout Default: false
pub fn run(self, user: &str, password: &str, homeserver_url: &str)
[src]
Blocking call that runs as long as the Bot is running. Will call for each incoming text-message the given MessageHandler. Bot will automatically join all rooms it is invited to. Will return on shutdown only. All messages prior to run() will be ignored.
Auto Trait Implementations
impl !RefUnwindSafe for MatrixBot
impl Send for MatrixBot
impl !Sync for MatrixBot
impl Unpin for MatrixBot
impl !UnwindSafe for MatrixBot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,