pub struct PersistentTransfer { /* private fields */ }Expand description
Filesystem-backed transfer state that survives process and device restart.
Each accepted chunk is installed atomically with no-clobber semantics. Incomplete staging files are ignored when the transfer is reopened.
Implementations§
Source§impl PersistentTransfer
impl PersistentTransfer
pub fn create( directory: impl AsRef<Path>, manifest: ChunkManifest, ) -> Result<Self, TransferError>
pub fn open(directory: impl AsRef<Path>) -> Result<Self, TransferError>
pub fn manifest(&self) -> &ChunkManifest
pub fn accept_chunk( &self, index: u32, bytes: &[u8], ) -> Result<bool, TransferError>
pub fn missing_chunks(&self) -> Result<Vec<u32>, TransferError>
pub fn assemble(&self) -> Result<Vec<u8>, TransferError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersistentTransfer
impl RefUnwindSafe for PersistentTransfer
impl Send for PersistentTransfer
impl Sync for PersistentTransfer
impl Unpin for PersistentTransfer
impl UnsafeUnpin for PersistentTransfer
impl UnwindSafe for PersistentTransfer
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