pub trait IAsyncToken {
    // Required methods
    fn get_session_id(&self) -> i64;
    fn new_serial(&self) -> i64;
    fn get_peer<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Option<Weak<NetPeer>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send<'life0, 'async_trait, B>(
        &'life0 self,
        buff: B
    ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
       where B: 'async_trait + Deref<Target = [u8]> + Send + Sync + 'static,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get_token<'life0, 'async_trait>(
        &'life0 self,
        session_id: i64
    ) -> Pin<Box<dyn Future<Output = Result<Option<NetxToken>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_tokens<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<Vec<NetxToken>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn call<'life0, 'async_trait>(
        &'life0 self,
        serial: i64,
        buff: Data
    ) -> Pin<Box<dyn Future<Output = Result<RetResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run<'life0, 'async_trait>(
        &'life0 self,
        buff: Data
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_disconnect<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

source

fn get_session_id(&self) -> i64

get netx session id

source

fn new_serial(&self) -> i64

new serial id

source

fn get_peer<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Option<Weak<NetPeer>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

get tcp socket peer

source

fn send<'life0, 'async_trait, B>( &'life0 self, buff: B ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where B: 'async_trait + Deref<Target = [u8]> + Send + Sync + 'static, Self: 'async_trait, 'life0: 'async_trait,

send buff

source

fn get_token<'life0, 'async_trait>( &'life0 self, session_id: i64 ) -> Pin<Box<dyn Future<Output = Result<Option<NetxToken>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

get netx token by session id

source

fn get_all_tokens<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<NetxToken>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

get all netx token

source

fn call<'life0, 'async_trait>( &'life0 self, serial: i64, buff: Data ) -> Pin<Box<dyn Future<Output = Result<RetResult>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

call

source

fn run<'life0, 'async_trait>( &'life0 self, buff: Data ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

run

source

fn is_disconnect<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

is disconnect

Implementors§