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>)
Response will be crate::response::ResponseInner::Status
.
Read
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
Responds with a crate::response::ResponseInner::Status
message.
Mkdir
Responds with a crate::response::ResponseInner::Status
message.
Rmdir(Cow<'a, Path>)
Responds with a crate::response::ResponseInner::Status
message.
Opendir(Cow<'a, Path>)
Responds with a crate::response::ResponseInner::Handle
or a crate::response::ResponseInner::Status
message.
Readdir(Cow<'a, Handle>)
Responds with a crate::response::ResponseInner::Name
or
a crate::response::ResponseInner::Status
message
Stat(Cow<'a, Path>)
Responds with crate::response::ResponseInner::Attrs
or
crate::response::ResponseInner::Status
.
Lstat(Cow<'a, Path>)
Responds with crate::response::ResponseInner::Attrs
or
crate::response::ResponseInner::Status
.
Does not follow symlink.
Fstat(Cow<'a, Handle>)
Responds with crate::response::ResponseInner::Attrs
or
crate::response::ResponseInner::Status
.
Setstat
Responds with a crate::response::ResponseInner::Status
message.
Fsetstat
Responds with a crate::response::ResponseInner::Status
message.
Readlink(Cow<'a, Path>)
Responds with crate::response::ResponseInner::Name
with a name and
dummy attribute value or crate::response::ResponseInner::Status
on error.
Symlink
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
.
HardLink
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
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
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
Auto Trait Implementations
impl<'a> RefUnwindSafe for RequestInner<'a>
impl<'a> Send for RequestInner<'a>
impl<'a> Sync for RequestInner<'a>
impl<'a> Unpin for RequestInner<'a>
impl<'a> UnwindSafe for RequestInner<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more