pub enum RequestInner<'a> {
Show 24 variants Open(OpenFileRequest<'a>), Close(Cow<'a, Handle>), Read { handle: Cow<'a, Handle>, offset: u64, len: u32, }, Remove(Cow<'a, Path>), Rename { oldpath: Cow<'a, Path>, newpath: Cow<'a, Path>, }, Mkdir { path: Cow<'a, Path>, attrs: FileAttrs, }, Rmdir(Cow<'a, Path>), Opendir(Cow<'a, Path>), Readdir(Cow<'a, Handle>), Stat(Cow<'a, Path>), Lstat(Cow<'a, Path>), Fstat(Cow<'a, Handle>), Setstat { path: Cow<'a, Path>, attrs: FileAttrs, }, Fsetstat { handle: Cow<'a, Handle>, attrs: FileAttrs, }, Readlink(Cow<'a, Path>), Symlink { linkpath: Cow<'a, Path>, targetpath: Cow<'a, Path>, }, Realpath(Cow<'a, Path>), Limits, ExpandPath(Cow<'a, Path>), Lsetstat(Cow<'a, Path>, FileAttrs), Fsync(Cow<'a, Handle>), HardLink { oldpath: Cow<'a, Path>, newpath: Cow<'a, Path>, }, PosixRename { oldpath: Cow<'a, Path>, newpath: Cow<'a, Path>, }, Write { handle: Cow<'a, Handle>, offset: u64, data: Cow<'a, [u8]>, },
}

Variants

Open(OpenFileRequest<'a>)

The response to this message will be either crate::response::ResponseInner::Handle (if the operation is successful) or crate::response::ResponseInner::Status (if the operation fails).

Close(Cow<'a, Handle>)

Read

Fields

handle: Cow<'a, Handle>
offset: u64
len: u32

In response to this request, the server will read as many bytes as it can from the file (up to `len’), and return them in a ResponseInner::Data message.

If an error occurs or EOF is encountered before reading any data, the server will respond with crate::response::ResponseInner::Status.

For normal disk files, it is guaranteed that this will read the specified number of bytes, or up to end of file.

For e.g. device files this may return fewer bytes than requested.

Remove(Cow<'a, Path>)

Responds with a crate::response::ResponseInner::Status message.

Rename

Fields

oldpath: Cow<'a, Path>
newpath: Cow<'a, Path>

Responds with a crate::response::ResponseInner::Status message.

Mkdir

Fields

path: Cow<'a, Path>
attrs: FileAttrs

Responds with a crate::response::ResponseInner::Status message.

Rmdir(Cow<'a, Path>)

Responds with a crate::response::ResponseInner::Status message.

Opendir(Cow<'a, Path>)

Readdir(Cow<'a, Handle>)

Stat(Cow<'a, Path>)

Lstat(Cow<'a, Path>)

Fstat(Cow<'a, Handle>)

Setstat

Fields

path: Cow<'a, Path>
attrs: FileAttrs

Responds with a crate::response::ResponseInner::Status message.

Fsetstat

Fields

handle: Cow<'a, Handle>
attrs: FileAttrs

Responds with a crate::response::ResponseInner::Status message.

Responds with crate::response::ResponseInner::Name with a name and dummy attribute value or crate::response::ResponseInner::Status on error.

Fields

linkpath: Cow<'a, Path>
targetpath: Cow<'a, Path>

Responds with a crate::response::ResponseInner::Status message.

Realpath(Cow<'a, Path>)

Responds with crate::response::ResponseInner::Name with a name and dummy attribute value or crate::response::ResponseInner::Status on error.

Limits

Responds with extended reply, with payload crate::response::Limits.

Extension, only available if it is crate::response::Extensions::limits is returned by crate::response::ServerVersion.

ExpandPath(Cow<'a, Path>)

Same response as RequestInner::Realpath.

Extension, only available if it is crate::response::Extensions::expand_path is returned by crate::response::ServerVersion.

This supports canonicalisation of relative paths and those that need tilde-expansion, i.e. “~”, “~/…” and “~user/…”.

These paths are expanded using shell-lilke rules and the resultant path is canonicalised similarly to RequestInner::Realpath.

Lsetstat(Cow<'a, Path>, FileAttrs)

Same response as RequestInner::Setstat.

Extension, only available if it is crate::response::Extensions::lsetstat is returned by crate::response::ServerVersion.

Fsync(Cow<'a, Handle>)

Responds with a crate::response::ResponseInner::Status message.

Extension, only available if it is crate::response::Extensions::fsync is returned by crate::response::ServerVersion.

Fields

oldpath: Cow<'a, Path>
newpath: Cow<'a, Path>

Responds with a crate::response::ResponseInner::Status message.

Extension, only available if it is crate::response::Extensions::hardlink is returned by crate::response::ServerVersion.

PosixRename

Fields

oldpath: Cow<'a, Path>
newpath: Cow<'a, Path>

Responds with a crate::response::ResponseInner::Status message.

Extension, only available if it is crate::response::Extensions::posix_rename is returned by crate::response::ServerVersion.

Write

Fields

handle: Cow<'a, Handle>
offset: u64
data: Cow<'a, [u8]>

The write will extend the file if writing beyond the end of the file.

It is legal to write way beyond the end of the file, the semantics are to write zeroes from the end of the file to the specified offset and then the data.

On most operating systems, such writes do not allocate disk space but instead leave “holes” in the file.

Responds with a crate::response::ResponseInner::Status message.

The Write also includes any amount of custom data and its size is included in the size of the entire packet sent.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.