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§
sourcefn get_attributes(
&self,
requested_attributes: NodeAttributesQuery,
) -> impl Future<Output = Result<NodeAttributes2, Status>> + Sendwhere
Self: Sized,
fn get_attributes(
&self,
requested_attributes: NodeAttributesQuery,
) -> impl Future<Output = Result<NodeAttributes2, Status>> + Sendwhere
Self: Sized,
Returns node attributes (io2).
Provided Methods§
sourcefn will_open_as_node(&self) -> Result<(), Status>
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.
sourcefn will_clone(&self)
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
.
fn link_into(
self: Arc<Self>,
_destination_dir: Arc<dyn MutableDirectory>,
_name: Name,
) -> impl Future<Output = Result<(), Status>> + Sendwhere
Self: Sized,
sourcefn query_filesystem(&self) -> Result<FilesystemInfo, Status>
fn query_filesystem(&self) -> Result<FilesystemInfo, Status>
Returns information about the filesystem.
sourcefn open_as_node(
self: Arc<Self>,
scope: ExecutionScope,
options: NodeOptions,
object_request: ObjectRequestRef<'_>,
) -> Result<(), Status>where
Self: Sized,
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.