Trait bip_utracker::ServerHandler [] [src]

pub trait ServerHandler: Send {
    fn connect<R>(&mut self, addr: SocketAddr, result: R)
    where
        R: for<'a> FnOnce(ServerResult<'a, u64>)
; fn announce<'b, R>(
        &mut self,
        addr: SocketAddr,
        id: u64,
        req: &AnnounceRequest<'b>,
        result: R
    )
    where
        R: for<'a> FnOnce(ServerResult<'a, AnnounceResponse<'a>>)
; fn scrape<'b, R>(
        &mut self,
        addr: SocketAddr,
        id: u64,
        req: &ScrapeRequest<'b>,
        result: R
    )
    where
        R: for<'a> FnOnce(ServerResult<'a, ScrapeResponse<'a>>)
; }

Trait for providing a TrackerServer with methods to service TrackerReqeusts.

Required Methods

Service a connection id request from the given address.

If the result callback is not called, no response will be sent.

Service an announce request with the given connect id.

If the result callback is not called, no response will be sent.

Service a scrape request with the given connect id.

If the result callback is not called, no response will be sent.

Implementors