Skip to main content

FsOp

Enum FsOp 

Source
pub enum FsOp {
Show 19 variants RealPath { path: String, }, Stat { path: String, follow_symlink: bool, }, SetStat { path: String, follow_symlink: bool, attrs: FsSetAttrs, }, List { path: String, }, ReadLink { path: String, }, Symlink { target: String, link_path: String, }, Mkdir { path: String, mode: Option<u32>, }, Remove { path: String, }, RemoveDir { path: String, recursive: bool, }, Copy { src: String, dst: String, }, Rename { src: String, dst: String, }, OpenFile { path: String, options: FsOpenOptions, }, OpenDir { path: String, }, CloseHandle { handle: u64, }, Read { handle: u64, offset: u64, len: Option<u64>, }, Write { handle: u64, offset: u64, len: Option<u64>, }, ReadDir { handle: u64, limit: Option<u32>, }, FStat { handle: u64, }, FSetStat { handle: u64, attrs: FsSetAttrs, },
}
Expand description

A filesystem operation requested by the host.

Variants§

§

RealPath

Resolve a path to its canonical absolute form.

Fields

§path: String

Guest path to resolve.

§

Stat

Get metadata for a path.

Fields

§path: String

Guest path to stat.

§follow_symlink: bool

Whether to follow symlinks.

§

SetStat

Update metadata for a path.

Fields

§path: String

Guest path to update.

§follow_symlink: bool

Whether to follow symlinks.

§attrs: FsSetAttrs

Attributes to update.

§

List

List directory contents.

Fields

§path: String

Guest directory path to list.

Read a symlink target.

Fields

§path: String

Guest symlink path to read.

Create a symlink.

Fields

§target: String

Symlink target.

§link_path: String

Symlink path to create.

§

Mkdir

Create a directory (and parents).

Fields

§path: String

Guest directory path to create.

§mode: Option<u32>

Permission bits to set on creation (e.g. 0o755).

§

Remove

Remove a file.

Fields

§path: String

Guest file path to remove.

§

RemoveDir

Remove a directory.

Fields

§path: String

Guest directory path to remove.

§recursive: bool

Whether to remove recursively.

§

Copy

Copy a file or directory within the guest.

Fields

§src: String

Source path in guest.

§dst: String

Destination path in guest.

§

Rename

Rename/move a file or directory.

Fields

§src: String

Source path in guest.

§dst: String

Destination path in guest.

§

OpenFile

Open a file and allocate an agentd-side handle.

Fields

§path: String

Guest file path to open.

§options: FsOpenOptions

File open options.

§

OpenDir

Open a directory and allocate an agentd-side handle.

Fields

§path: String

Guest directory path to open.

§

CloseHandle

Close a file or directory handle.

Fields

§handle: u64

Agentd-side handle.

§

Read

Read from an open file handle.

Fields

§handle: u64

Agentd-side file handle.

§offset: u64

Byte offset to read from.

§len: Option<u64>

Maximum bytes to read. None means read to EOF.

§

Write

Write to an open file handle.

Fields

§handle: u64

Agentd-side file handle.

§offset: u64

Byte offset to write at.

§len: Option<u64>

Expected byte count. None disables count validation.

§

ReadDir

Read the next batch of entries from an open directory handle.

Fields

§handle: u64

Agentd-side directory handle.

§limit: Option<u32>

Maximum entries to return. None uses the agent default.

§

FStat

Get metadata for an open file or directory handle.

Fields

§handle: u64

Agentd-side handle.

§

FSetStat

Update metadata for an open file handle.

Fields

§handle: u64

Agentd-side handle.

§attrs: FsSetAttrs

Attributes to update.

Trait Implementations§

Source§

impl Clone for FsOp

Source§

fn clone(&self) -> FsOp

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FsOp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FsOp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FsOp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for FsOp

§

impl RefUnwindSafe for FsOp

§

impl Send for FsOp

§

impl Sync for FsOp

§

impl Unpin for FsOp

§

impl UnsafeUnpin for FsOp

§

impl UnwindSafe for FsOp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,