pub struct DriverContext {
pub root_dispatcher: DispatcherRef<'static>,
pub start_args: DriverStartArgs,
pub incoming: Incoming,
/* private fields */
}
Expand description
The context arguments passed to the driver in its start arguments.
Fields§
§root_dispatcher: DispatcherRef<'static>
A reference to the root [fdf::Dispatcher
] for this driver.
start_args: DriverStartArgs
The original DriverStartArgs
passed in as start arguments, minus any parts that were
used to construct other elements of Self
.
incoming: Incoming
The incoming namespace constructed from DriverStartArgs::incoming
. Since producing this
consumes the incoming namespace from Self::start_args
, that will always be None
.
Implementations§
Source§impl DriverContext
impl DriverContext
Sourcepub fn take_node(&mut self) -> Result<Node, Status>
pub fn take_node(&mut self) -> Result<Node, Status>
Binds the node proxy client end from the start args into a [NodeProxy
] that can be used
to add child nodes. Dropping this proxy will result in the node being removed and the
driver starting shutdown, so it should be bound and stored in your driver object in its
crate::Driver::start
method.
After calling this, DriverStartArgs::node
in Self::start_args
will be None
.
Returns [Status::INVALID_ARGS
] if the node client end is not present in the start
arguments.
Sourcepub fn serve_outgoing<O: ServiceObjTrait>(
&mut self,
outgoing_fs: &mut ServiceFs<O>,
) -> Result<(), Status>
pub fn serve_outgoing<O: ServiceObjTrait>( &mut self, outgoing_fs: &mut ServiceFs<O>, ) -> Result<(), Status>
Serves the given [ServiceFs
] on the node’s outgoing directory. This can only be called
once, and after this the DriverStartArgs::outgoing_dir
member will be None
.
Logs an error and returns [Status::INVALID_ARGS
] if the outgoing directory server end is
not present in the start arguments, or [Status::INTERNAL
] if serving the connection
failed.