pub struct ControlFile { /* private fields */ }Implementations§
Source§impl ControlFile
impl ControlFile
pub fn path(&self) -> &Path
pub fn total_length(&self) -> u64
pub fn completed_length(&self) -> u64
pub fn bitfield(&self) -> &[u8] ⓘ
pub fn set_checksum(&mut self, algo: u8, value: Vec<u8>)
pub fn checksum_algo(&self) -> u8
pub async fn open_or_create( ctrl_path: &Path, total_length: u64, num_pieces: usize, ) -> Result<Self>
pub async fn load(path: &Path) -> Result<Option<Self>>
pub async fn save(&self) -> Result<()>
pub fn mark_piece_done(&mut self, index: usize)
pub fn is_piece_done(&self, index: usize) -> bool
pub fn completed_pieces(&self) -> usize
pub fn update_completed_length(&mut self, length: u64)
pub fn control_path_for(output_path: &Path) -> PathBuf
Trait Implementations§
Source§impl Clone for ControlFile
impl Clone for ControlFile
Source§fn clone(&self) -> ControlFile
fn clone(&self) -> ControlFile
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 ControlFile
impl RefUnwindSafe for ControlFile
impl Send for ControlFile
impl Sync for ControlFile
impl Unpin for ControlFile
impl UnsafeUnpin for ControlFile
impl UnwindSafe for ControlFile
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