pub struct WriteOp {
pub file: VfFile,
pub offset: VfOffset,
pub data: Vec<u8>,
pub creation: bool,
pub truncate: bool,
}Expand description
One element of a batched write.
Fields§
§file: VfFile§offset: VfOffset§data: Vec<u8>§creation: boolCreate the file if it does not exist.
truncate: boolTruncate the file to zero before writing (POSIX O_TRUNC semantics
fused into the same round trip as the write).
Implementations§
Source§impl WriteOp
impl WriteOp
pub fn new(file: VfFile, offset: VfOffset, data: Vec<u8>) -> WriteOp
pub fn from_path(path: &str, offset: VfOffset, data: Vec<u8>) -> WriteOp
Sourcepub fn from_os_path(path: &Path, offset: VfOffset, data: Vec<u8>) -> WriteOp
pub fn from_os_path(path: &Path, offset: VfOffset, data: Vec<u8>) -> WriteOp
Construct a write from a native path.
pub fn from_fd(fd: i32, offset: VfOffset, data: Vec<u8>) -> WriteOp
Sourcepub fn with_creation(self) -> WriteOp
pub fn with_creation(self) -> WriteOp
Create the file if it does not exist.
Sourcepub fn with_truncate(self) -> WriteOp
pub fn with_truncate(self) -> WriteOp
Truncate the file to zero before writing, in the same round trip.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WriteOp
impl RefUnwindSafe for WriteOp
impl Send for WriteOp
impl Sync for WriteOp
impl Unpin for WriteOp
impl UnsafeUnpin for WriteOp
impl UnwindSafe for WriteOp
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