PingSession

Trait PingSession 

Source
pub trait PingSession:
    Send
    + Sync
    + Display {
    // Required methods
    fn sn(&self) -> &DeviceId;
    fn local(&self) -> Endpoint;
    fn reset(
        &self,
        local_device: Option<Device>,
        sn_endpoint: Option<Endpoint>,
    ) -> Box<dyn PingSession>;
    fn clone_as_ping_session(&self) -> Box<dyn PingSession>;
    fn wait<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = BuckyResult<PingSessionResp>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stop(&self);

    // Provided methods
    fn on_time_escape(&self, _now: Timestamp) { ... }
    fn on_udp_ping_resp(
        &self,
        _resp: &SnPingResp,
        _from: &Endpoint,
    ) -> BuckyResult<()> { ... }
}

Required Methods§

Source

fn sn(&self) -> &DeviceId

Source

fn local(&self) -> Endpoint

Source

fn reset( &self, local_device: Option<Device>, sn_endpoint: Option<Endpoint>, ) -> Box<dyn PingSession>

Source

fn clone_as_ping_session(&self) -> Box<dyn PingSession>

Source

fn wait<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = BuckyResult<PingSessionResp>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn stop(&self)

Provided Methods§

Source

fn on_time_escape(&self, _now: Timestamp)

Source

fn on_udp_ping_resp( &self, _resp: &SnPingResp, _from: &Endpoint, ) -> BuckyResult<()>

Implementors§