Enum fuse_backend_rs::passthrough::CachePolicy
source · pub enum CachePolicy {
Never,
Metadata,
Auto,
Always,
}
Expand description
The caching policy that the file system should report to the FUSE client. By default the FUSE protocol uses close-to-open consistency. This means that any cached contents of the file are invalidated the next time that file is opened.
Variants§
Never
The client should never cache file data and all I/O should be directly forwarded to the server. This policy must be selected when file contents may change without the knowledge of the FUSE client (i.e., the file system does not have exclusive access to the directory).
Metadata
This is almost same as Never, but it allows page cache of directories, dentries and attr cache in guest. In other words, it acts like cache=never for normal files, and like cache=always for directories, besides, metadata like dentries and attrs are kept as well. This policy can be used if:
- the client wants to use Never policy but it’s performance in I/O is not good enough
- the file system has exclusive access to the directory
- cache directory content and other fs metadata can make a difference on performance.
Auto
The client is free to choose when and how to cache file data. This is the default policy and uses close-to-open consistency as described in the enum documentation.
Always
The client should always cache file data. This means that the FUSE client will not invalidate any cached data that was returned by the file system the last time the file was opened. This policy should only be selected when the file system has exclusive access to the directory.
Trait Implementations§
source§impl Clone for CachePolicy
impl Clone for CachePolicy
source§fn clone(&self) -> CachePolicy
fn clone(&self) -> CachePolicy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CachePolicy
impl Debug for CachePolicy
source§impl Default for CachePolicy
impl Default for CachePolicy
source§fn default() -> CachePolicy
fn default() -> CachePolicy
source§impl FromStr for CachePolicy
impl FromStr for CachePolicy
source§impl PartialEq for CachePolicy
impl PartialEq for CachePolicy
impl Eq for CachePolicy
impl StructuralPartialEq for CachePolicy
Auto Trait Implementations§
impl Freeze for CachePolicy
impl RefUnwindSafe for CachePolicy
impl Send for CachePolicy
impl Sync for CachePolicy
impl Unpin for CachePolicy
impl UnwindSafe for CachePolicy
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)