pub struct WriteOp<'a, H>where
H: FileHandle + 'a,{ /* private fields */ }Expand description
A positional write borrowing its handle and payload without copying either. Construction performs no I/O or allocation. Does not change the file cursor.
Implementations§
Source§impl<'a, H> WriteOp<'a, H>where
H: FileHandle,
impl<'a, H> WriteOp<'a, H>where
H: FileHandle,
Sourcepub fn at(file: &'a H, offset: u64, data: &'a [u8]) -> WriteOp<'a, H>
pub fn at(file: &'a H, offset: u64, data: &'a [u8]) -> WriteOp<'a, H>
Prepare a write at an absolute byte offset; validation happens at dispatch.
use vfsi_core::api::{Vfsi, VfsiExt, WriteOp};
let file = fs.create("/output")?;
let result = fs.vwrite(&[WriteOp::at(&file, 0, b"hello")], vfsi_core::api::WriteOptions::new().write_all(true));
let close = fs.close_files(vec![file]);
result?;
close?;Trait Implementations§
Source§impl<H> Clone for WriteOp<'_, H>where
H: FileHandle,
impl<H> Clone for WriteOp<'_, H>where
H: FileHandle,
impl<H> Copy for WriteOp<'_, H>where
H: FileHandle,
Auto Trait Implementations§
impl<'a, H> Freeze for WriteOp<'a, H>
impl<'a, H> RefUnwindSafe for WriteOp<'a, H>where
&'a H: RefUnwindSafe,
impl<'a, H> Send for WriteOp<'a, H>
impl<'a, H> Sync for WriteOp<'a, H>
impl<'a, H> Unpin for WriteOp<'a, H>
impl<'a, H> UnsafeUnpin for WriteOp<'a, H>where
&'a H: UnsafeUnpin,
impl<'a, H> UnwindSafe for WriteOp<'a, H>where
&'a H: UnwindSafe,
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