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.
Auto Trait Implementations§
impl Freeze for DriverContext
impl RefUnwindSafe for DriverContext
impl Send for DriverContext
impl Sync for DriverContext
impl Unpin for DriverContext
impl UnwindSafe for DriverContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more