Trait vfs::node::Node

source ·
pub trait Node: GetEntryInfo + IntoAny + Send + Sync + 'static {
    // Required method
    fn get_attributes(
        &self,
        requested_attributes: NodeAttributesQuery,
    ) -> impl Future<Output = Result<NodeAttributes2, Status>> + Send
       where Self: Sized;

    // Provided methods
    fn will_open_as_node(&self) -> Result<(), Status> { ... }
    fn will_clone(&self) { ... }
    fn close(self: Arc<Self>) { ... }
    fn link_into(
        self: Arc<Self>,
        _destination_dir: Arc<dyn MutableDirectory>,
        _name: Name,
    ) -> impl Future<Output = Result<(), Status>> + Send
       where Self: Sized { ... }
    fn query_filesystem(&self) -> Result<FilesystemInfo, Status> { ... }
    fn open_as_node(
        self: Arc<Self>,
        scope: ExecutionScope,
        options: NodeOptions,
        object_request: ObjectRequestRef<'_>,
    ) -> Result<(), Status>
       where Self: Sized { ... }
}
Expand description

All nodes must implement this trait.

Required Methods§

source

fn get_attributes( &self, requested_attributes: NodeAttributesQuery, ) -> impl Future<Output = Result<NodeAttributes2, Status>> + Send
where Self: Sized,

Returns node attributes (io2).

Provided Methods§

source

fn will_open_as_node(&self) -> Result<(), Status>

Called when the node is about to be opened as the node protocol. Implementers can use this to perform any initialization or reference counting. Errors here will result in the open failing. By default, this forwards to the infallible will_clone.

source

fn will_clone(&self)

Called when the node is about to be cloned (and also by the default implementation of will_open_as_node). Implementations that perform their own open count can use this. Each call to will_clone will be accompanied by an eventual call to close.

source

fn close(self: Arc<Self>)

Called when the node is closed.

source

fn query_filesystem(&self) -> Result<FilesystemInfo, Status>

Returns information about the filesystem.

source

fn open_as_node( self: Arc<Self>, scope: ExecutionScope, options: NodeOptions, object_request: ObjectRequestRef<'_>, ) -> Result<(), Status>
where Self: Sized,

Opens the node using the node protocol.

Implementors§