pub struct MetadataScheduler { /* private fields */ }Implementations§
Source§impl MetadataScheduler
impl MetadataScheduler
pub fn new( hash_rx: Receiver<HashDiscovered>, fetcher: Arc<RbitFetcher>, max_queue_size: usize, max_concurrent: usize, callback: Arc<RwLock<Option<Arc<dyn Fn(TorrentInfo) + Send + Sync>>>>, on_metadata_fetch: Arc<RwLock<Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = bool> + Send>> + Send + Sync>>>>, queue_len: Arc<AtomicUsize>, shutdown: CancellationToken, ) -> Self
pub fn set_callback(&mut self, callback: Arc<dyn Fn(TorrentInfo) + Send + Sync>)
pub fn set_metadata_fetch_callback( &mut self, callback: Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = bool> + Send>> + Send + Sync>, )
pub async fn run(self)
Auto Trait Implementations§
impl Freeze for MetadataScheduler
impl RefUnwindSafe for MetadataScheduler
impl Send for MetadataScheduler
impl Sync for MetadataScheduler
impl Unpin for MetadataScheduler
impl UnwindSafe for MetadataScheduler
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