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:

  1. the client wants to use Never policy but it’s performance in I/O is not good enough
  2. the file system has exclusive access to the directory
  3. 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

source§

fn clone(&self) -> CachePolicy

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for CachePolicy

source§

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

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

impl Default for CachePolicy

source§

fn default() -> CachePolicy

Returns the “default value” for a type. Read more
source§

impl FromStr for CachePolicy

source§

type Err = &'static str

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq for CachePolicy

source§

fn eq(&self, other: &CachePolicy) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for CachePolicy

source§

impl StructuralPartialEq for CachePolicy

Auto Trait Implementations§

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.