pub trait ServerHandler: Send {
// Required methods
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>>);
}Expand description
Trait for providing a TrackerServer with methods to service TrackerReqeusts.
Required Methods§
Sourcefn connect<R>(&mut self, addr: SocketAddr, result: R)
fn connect<R>(&mut self, addr: SocketAddr, result: R)
Service a connection id request from the given address.
If the result callback is not called, no response will be sent.
Sourcefn announce<'b, R>(
&mut self,
addr: SocketAddr,
id: u64,
req: &AnnounceRequest<'b>,
result: R,
)
fn announce<'b, R>( &mut self, addr: SocketAddr, id: u64, req: &AnnounceRequest<'b>, result: R, )
Service an announce request with the given connect id.
If the result callback is not called, no response will be sent.
Sourcefn scrape<'b, R>(
&mut self,
addr: SocketAddr,
id: u64,
req: &ScrapeRequest<'b>,
result: R,
)
fn scrape<'b, R>( &mut self, addr: SocketAddr, id: u64, req: &ScrapeRequest<'b>, result: R, )
Service a scrape request with the given connect id.
If the result callback is not called, no response will be sent.
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.