Struct OverlayNode

Source
pub struct OverlayNode {
    name: String,
    overlay_fs: RwLock<Option<Arc<OverlayFS>>>,
    path: String,
    file_type: FileType,
    file_id: u64,
}
Expand description

A composite node that represents a file/directory across overlay layers

OverlayNode serves as a virtual representation of a file or directory that may exist in one or more layers of the overlay filesystem. It handles the resolution of operations across these layers according to overlay semantics.

§Design

Each OverlayNode represents a specific path in the overlay and delegates operations to the appropriate underlying filesystem layers. The node itself doesn’t store file content but rather coordinates access to the real nodes in the upper and lower layers.

Fields§

§name: String

Node name

§overlay_fs: RwLock<Option<Arc<OverlayFS>>>

Reference to overlay filesystem

§path: String

Path in the overlay

§file_type: FileType

File type (resolved from layers)

§file_id: u64

File ID

Implementations§

Source§

impl OverlayNode

Source

pub fn new( name: String, path: String, file_type: FileType, file_id: u64, ) -> Arc<Self>

Source

pub fn set_overlay_fs(&self, fs: Arc<OverlayFS>)

Trait Implementations§

Source§

impl Clone for OverlayNode

Source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl VfsNode for OverlayNode

Source§

fn id(&self) -> u64

Returns the unique identifier in the filesystem
Source§

fn filesystem(&self) -> Option<Weak<dyn FileSystemOperations>>

Returns a (Weak) reference to the filesystem this node belongs to
Source§

fn metadata(&self) -> Result<FileMetadata, FileSystemError>

Get metadata for this node
Source§

fn as_any(&self) -> &dyn Any

Helper for downcasting
Source§

fn file_type(&self) -> Result<FileType, FileSystemError>

Get the file type of this node
Source§

fn is_directory(&self) -> Result<bool, FileSystemError>

Returns true if this node is a directory
Returns true if this node is a symbolic link
Read the target of a symbolic link (returns error if not a symlink)

Auto Trait Implementations§

§

impl !Freeze for OverlayNode

§

impl !RefUnwindSafe for OverlayNode

§

impl Send for OverlayNode

§

impl Sync for OverlayNode

§

impl Unpin for OverlayNode

§

impl !UnwindSafe for OverlayNode

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.