Method

Trait Method 

Source
pub trait Method {
    // Required methods
    fn new(token: String) -> Self;
    fn keyboard<T: Serialize + Send, N: NdArray<T> + Send>(
        &self,
        message: &str,
        one_time: bool,
        inline: bool,
        buttons: N,
    ) -> impl Future<Output = Result<()>> + Send;
    fn event_answer<'de, T: Serialize + Send, A: DeserializeOwned + PartialEq + Serialize + Send>(
        &self,
        event_data: T,
        payload: A,
    ) -> impl Future<Output = Result<Option<A>>> + Send;
    fn reply(&self, message: &str) -> impl Future<Output = ()> + Send;
    fn long_poll(
        &self,
        group_id: u32,
    ) -> impl Future<Output = LongPollResponse> + Send;
    fn connect(
        &self,
        server: &str,
        token: String,
        ts: String,
        wait: usize,
    ) -> impl Future<Output = Ctx> + Send;
    fn get_users(
        &self,
        user_ids: &[i32],
    ) -> impl Future<Output = Result<Vec<User>>> + Send;
    fn get_members(
        &self,
        offset: Option<u16>,
        count: Option<u16>,
        extended: bool,
    ) -> impl Future<Output = Result<Members>> + Send;
    fn custom_request(&self) -> &RequestBuilder;
    fn context(&self) -> impl Future<Output = RwLockReadGuard<'_, Ctx>> + Send;
}

Required Methods§

Source

fn new(token: String) -> Self

Source

fn keyboard<T: Serialize + Send, N: NdArray<T> + Send>( &self, message: &str, one_time: bool, inline: bool, buttons: N, ) -> impl Future<Output = Result<()>> + Send

Source

fn event_answer<'de, T: Serialize + Send, A: DeserializeOwned + PartialEq + Serialize + Send>( &self, event_data: T, payload: A, ) -> impl Future<Output = Result<Option<A>>> + Send

Source

fn reply(&self, message: &str) -> impl Future<Output = ()> + Send

Source

fn long_poll( &self, group_id: u32, ) -> impl Future<Output = LongPollResponse> + Send

Source

fn connect( &self, server: &str, token: String, ts: String, wait: usize, ) -> impl Future<Output = Ctx> + Send

Source

fn get_users( &self, user_ids: &[i32], ) -> impl Future<Output = Result<Vec<User>>> + Send

Source

fn get_members( &self, offset: Option<u16>, count: Option<u16>, extended: bool, ) -> impl Future<Output = Result<Members>> + Send

Source

fn custom_request(&self) -> &RequestBuilder

Source

fn context(&self) -> impl Future<Output = RwLockReadGuard<'_, Ctx>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§