Skip to main content

Layer

Trait Layer 

Source
pub trait Layer: ObjectSafeFilesystem {
    // Required method
    fn root_inode(&self) -> Inode;

    // Provided methods
    fn create_whiteout<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: Request,
        parent: Inode,
        name: &'life1 OsStr,
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn delete_whiteout<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: Request,
        parent: Inode,
        name: &'life1 OsStr,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn is_whiteout<'life0, 'async_trait>(
        &'life0 self,
        ctx: Request,
        inode: Inode,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn set_opaque<'life0, 'async_trait>(
        &'life0 self,
        ctx: Request,
        inode: Inode,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn is_opaque<'life0, 'async_trait>(
        &'life0 self,
        ctx: Request,
        inode: Inode,
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn create_with_context<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: OperationContext,
        _parent: Inode,
        _name: &'life1 OsStr,
        _mode: u32,
        _flags: u32,
    ) -> Pin<Box<dyn Future<Output = Result<ReplyCreated>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn mkdir_with_context<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _ctx: OperationContext,
        _parent: Inode,
        _name: &'life1 OsStr,
        _mode: u32,
        _umask: u32,
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn symlink_with_context<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        _ctx: OperationContext,
        _parent: Inode,
        _name: &'life1 OsStr,
        _link: &'life2 OsStr,
    ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn getattr_with_mapping<'life0, 'async_trait>(
        &'life0 self,
        _inode: Inode,
        _handle: Option<u64>,
        _mapping: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(stat64, Duration)>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A filesystem must implement Layer trait, or it cannot be used as an OverlayFS layer.

Required Methods§

Source

fn root_inode(&self) -> Inode

Return the root inode number

Provided Methods§

Source

fn create_whiteout<'life0, 'life1, 'async_trait>( &'life0 self, ctx: Request, parent: Inode, name: &'life1 OsStr, ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create whiteout file with name .

If this call is successful then the lookup count of the Inode associated with the returned Entry must be increased by 1.

Source

fn delete_whiteout<'life0, 'life1, 'async_trait>( &'life0 self, ctx: Request, parent: Inode, name: &'life1 OsStr, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete whiteout file with name .

Source

fn is_whiteout<'life0, 'async_trait>( &'life0 self, ctx: Request, inode: Inode, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Check if the Inode is a whiteout file

Source

fn set_opaque<'life0, 'async_trait>( &'life0 self, ctx: Request, inode: Inode, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Set the directory to opaque.

Source

fn is_opaque<'life0, 'async_trait>( &'life0 self, ctx: Request, inode: Inode, ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Check if the directory is opaque.

Source

fn create_with_context<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: OperationContext, _parent: Inode, _name: &'life1 OsStr, _mode: u32, _flags: u32, ) -> Pin<Box<dyn Future<Output = Result<ReplyCreated>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a file with explicit ownership context. Uses OperationContext to allow overriding UID/GID for internal operations like copy-up.

Source

fn mkdir_with_context<'life0, 'life1, 'async_trait>( &'life0 self, _ctx: OperationContext, _parent: Inode, _name: &'life1 OsStr, _mode: u32, _umask: u32, ) -> Pin<Box<dyn Future<Output = Result<ReplyEntry>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a directory with explicit ownership context. Uses OperationContext to allow overriding UID/GID for internal operations like copy-up.

Create a symbolic link with explicit ownership context. Uses OperationContext to allow overriding UID/GID for internal operations like copy-up.

Source

fn getattr_with_mapping<'life0, 'async_trait>( &'life0 self, _inode: Inode, _handle: Option<u64>, _mapping: bool, ) -> Pin<Box<dyn Future<Output = Result<(stat64, Duration)>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Retrieve metadata with optional ID mapping control.

  • mapping: true: Returns attributes as seen inside the container (mapped).
  • mapping: false: Returns raw attributes on the host filesystem (unmapped).

Implementors§