pub struct VirtualFile { /* private fields */ }Expand description
Describes one virtual file exposed to a receiving application.
A virtual file consists of a name, an optional known size, and a
crate::FileSource that supplies its contents on demand.
The file need not exist as a physical file on the source machine.
Implementations§
Source§impl VirtualFile
impl VirtualFile
Sourcepub fn new(name: &str, source: Box<dyn FileSource>) -> Result<Self>
pub fn new(name: &str, source: Box<dyn FileSource>) -> Result<Self>
Creates a virtual file with an unknown size.
name may be a relative path such as reports/2026/report.txt.
The name and its path components are validated for the target platform.
A separate transfer-level check rejects duplicate or conflicting paths.
§Errors
Returns crate::Error::InvalidInput when the
name is empty or invalid.
Auto Trait Implementations§
impl !RefUnwindSafe for VirtualFile
impl !UnwindSafe for VirtualFile
impl Freeze for VirtualFile
impl Send for VirtualFile
impl Sync for VirtualFile
impl Unpin for VirtualFile
impl UnsafeUnpin for VirtualFile
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