pub struct UdpTrackerClient { /* private fields */ }Implementations§
Source§impl UdpTrackerClient
impl UdpTrackerClient
pub async fn new(bind_port: u16) -> Result<Self, String>
pub async fn add_announce( &mut self, addr: &SocketAddr, info_hash: &[u8; 20], peer_id: &[u8; 20], downloaded: i64, left: i64, uploaded: i64, event: UdpEvent, num_want: i32, port: u16, )
Sourcepub async fn add_scrape(&mut self, addr: &SocketAddr, info_hashes: &[[u8; 20]])
pub async fn add_scrape(&mut self, addr: &SocketAddr, info_hashes: &[[u8; 20]])
Add a SCRAPE request to query statistics for one or more info hashes
§Arguments
addr- UDP tracker socket addressinfo_hashes- Slice of 20-byte info hashes to query (max ~74 per request)
pub async fn process_one(&mut self) -> bool
pub async fn handle_response(&mut self, data: &[u8], from: &SocketAddr)
pub async fn handle_timeouts(&mut self)
pub fn no_pending(&self) -> bool
pub fn completed_requests(&self) -> Vec<&AnnounceResponse>
Sourcepub fn completed_scrape_results(&self) -> Vec<&Vec<ScrapeResult>>
pub fn completed_scrape_results(&self) -> Vec<&Vec<ScrapeResult>>
Get all completed scrape results from pending requests
pub fn socket(&self) -> Arc<UdpSocket> ⓘ
Auto Trait Implementations§
impl Freeze for UdpTrackerClient
impl RefUnwindSafe for UdpTrackerClient
impl Send for UdpTrackerClient
impl Sync for UdpTrackerClient
impl Unpin for UdpTrackerClient
impl UnsafeUnpin for UdpTrackerClient
impl UnwindSafe for UdpTrackerClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more