[][src]Struct matrix_bot_api::MatrixBot

pub struct MatrixBot { /* fields omitted */ }

Methods

impl MatrixBot[src]

pub fn new<M>(handler: M) -> MatrixBot where
    M: MessageHandler + 'static + Send
[src]

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]

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err