pub enum PreallocateMode {
None,
Sparse,
Full,
}Expand description
Pre-allocation strategy for torrent files.
Sibling of StorageMode; both live in
irontide-core so configuration crates can reference them without
depending on irontide-storage.
Variants§
None
No pre-allocation — files created sparse via set_len.
Sparse
Reserve extents without write amplification (FALLOC_FL_KEEP_SIZE on Linux).
Falls back to None on unsupported filesystems.
Full
Full allocation — fallocate(0) on Linux, falls back to writing zeros.
Trait Implementations§
Source§impl Clone for PreallocateMode
impl Clone for PreallocateMode
Source§fn clone(&self) -> PreallocateMode
fn clone(&self) -> PreallocateMode
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 moreSource§impl Debug for PreallocateMode
impl Debug for PreallocateMode
Source§impl Default for PreallocateMode
impl Default for PreallocateMode
Source§fn default() -> PreallocateMode
fn default() -> PreallocateMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PreallocateMode
impl<'de> Deserialize<'de> for PreallocateMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<bool> for PreallocateMode
impl From<bool> for PreallocateMode
Source§impl PartialEq for PreallocateMode
impl PartialEq for PreallocateMode
Source§fn eq(&self, other: &PreallocateMode) -> bool
fn eq(&self, other: &PreallocateMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PreallocateMode
impl Serialize for PreallocateMode
impl Copy for PreallocateMode
impl Eq for PreallocateMode
impl StructuralPartialEq for PreallocateMode
Auto Trait Implementations§
impl Freeze for PreallocateMode
impl RefUnwindSafe for PreallocateMode
impl Send for PreallocateMode
impl Sync for PreallocateMode
impl Unpin for PreallocateMode
impl UnsafeUnpin for PreallocateMode
impl UnwindSafe for PreallocateMode
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