[][src]Struct vk_bot::context::Context

pub struct Context<'api> { /* fields omitted */ }

Stores information necessary for handlers, allows to send the resulting message.

Methods

impl<'api> Context<'api>[src]

pub fn new(event: Event, req: &CallbackAPIRequest, api: &'api APIClient) -> Self[src]

Creates a new Context.

Panics

pub fn group_id(&self) -> i32[src]

Returns the group ID.

pub fn event(&self) -> Event[src]

Returns the original Callback API event type that caused this handler to run.

pub fn object(&self) -> &Object[src]

Returns the object associated with the event (given by Callback API).

pub fn api(&self) -> &APIClient[src]

Returns the global rvk::APIClient which is used in this bot.

pub fn response(&mut self) -> &mut Response[src]

Returns the current pending response object (mutable).

pub fn send(&self) -> Result<(), Error>[src]

Sends the response.

This does not erase the response object. You can send multiple messages.

This method currently blocks until the rvk::APIClient is available, so only one message is being sent at a given time. This behavior may change.

Trait Implementations

impl<'api> Debug for Context<'api>[src]

Auto Trait Implementations

impl<'api> !RefUnwindSafe for Context<'api>

impl<'api> Send for Context<'api>

impl<'api> Sync for Context<'api>

impl<'api> Unpin for Context<'api>

impl<'api> !UnwindSafe for Context<'api>

Blanket Implementations

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

impl<T, I> AsResult<T, I> for T where
    I: Input, 

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

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

impl<T> Erased for T

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

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

impl<T> IntoCollection<T> for T

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

impl<T> Typeable for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,