pub struct DiskManagerHandle { /* private fields */ }Expand description
Session-level handle for managing the disk subsystem.
Implementations§
Source§impl DiskManagerHandle
impl DiskManagerHandle
Sourcepub fn new(config: DiskConfig) -> (Self, JoinHandle<()>)
pub fn new(config: DiskConfig) -> (Self, JoinHandle<()>)
Create a new disk manager with the default backend selected from config.
Returns the handle and a JoinHandle for the background actor task.
Sourcepub async fn register_torrent(
&self,
info_hash: Id20,
storage: Arc<dyn TorrentStorage>,
) -> DiskHandle
pub async fn register_torrent( &self, info_hash: Id20, storage: Arc<dyn TorrentStorage>, ) -> DiskHandle
Register a torrent’s storage with the disk subsystem and return a
per-torrent DiskHandle.
Sourcepub async fn unregister_torrent(&self, info_hash: Id20)
pub async fn unregister_torrent(&self, info_hash: Id20)
Unregister a torrent, flushing and clearing its write buffer and cache.
Trait Implementations§
Source§impl Clone for DiskManagerHandle
impl Clone for DiskManagerHandle
Source§fn clone(&self) -> DiskManagerHandle
fn clone(&self) -> DiskManagerHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DiskManagerHandle
impl !RefUnwindSafe for DiskManagerHandle
impl Send for DiskManagerHandle
impl Sync for DiskManagerHandle
impl Unpin for DiskManagerHandle
impl UnsafeUnpin for DiskManagerHandle
impl !UnwindSafe for DiskManagerHandle
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