pub enum Allocate {
Extend,
KeepSize,
PunchHole,
ZeroRange,
}Expand description
How a call to File::allocate changes the space
a range of a file uses.
Variants§
Extend
Reserves disk space for the range, so a later write into it does not run out of space, and grows the file to cover the range when the range ends past its end. The new part reads as zeros.
KeepSize
Reserves disk space for the range and leaves the file’s length as it is.
PunchHole
Frees the disk space of the range, which then reads as zeros, and leaves the file’s length as it is. A range that ends past the end of the file does not grow it.
ZeroRange
Makes the range read as zeros, without a write of zeros, and grows the file to cover the range when it ends past the end, as a write of zeros would.
Trait Implementations§
impl Copy for Allocate
impl Eq for Allocate
impl StructuralPartialEq for Allocate
Auto Trait Implementations§
impl Freeze for Allocate
impl RefUnwindSafe for Allocate
impl Send for Allocate
impl Sync for Allocate
impl Unpin for Allocate
impl UnsafeUnpin for Allocate
impl UnwindSafe for Allocate
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