Trait netxserver::server::async_token::IAsyncToken
source · 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§
sourcefn get_session_id(&self) -> i64
fn get_session_id(&self) -> i64
get netx session id
sourcefn new_serial(&self) -> i64
fn new_serial(&self) -> i64
new serial id
sourcefn 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 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
sourcefn 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 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
sourcefn 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_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
sourcefn 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 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
sourcefn 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 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