pub struct Splice { /* private fields */ }Expand description
Zero-copy data transfer between two file descriptors.
Uses the kernel’s splice(2) syscall to move data directly from one
file descriptor to another through the kernel pipe buffer. No data
crosses the kernel-userspace boundary.
§Requirements
At least one of fd_in or fd_out must be a pipe. For file-to-pipe
transfers (the warpscan output path), open the source file and splice
directly to stdout.
§Example
use wireshift_core::ops::Splice;
use std::fs::File;
let src = File::open("data.bin").unwrap();
let dst = File::create("/dev/stdout").unwrap();
let op = Splice::new(src, Some(0), dst, None, 4096).unwrap();Implementations§
Trait Implementations§
Source§impl Op for Splice
impl Op for Splice
Source§type Output = SpliceResult
type Output = SpliceResult
Successful output type.
Source§fn into_descriptor(self) -> Result<OpDescriptor>
fn into_descriptor(self) -> Result<OpDescriptor>
Converts the operation into a backend descriptor.
Source§fn map_completion(payload: CompletionPayload) -> Result<Self::Output>
fn map_completion(payload: CompletionPayload) -> Result<Self::Output>
Maps a backend payload into the public output type.
Auto Trait Implementations§
impl Freeze for Splice
impl RefUnwindSafe for Splice
impl Send for Splice
impl Sync for Splice
impl Unpin for Splice
impl UnsafeUnpin for Splice
impl UnwindSafe for Splice
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