#[non_exhaustive]pub struct DriverContext {
pub root_dispatcher: DispatcherRef<'static>,
pub start_args: DriverStartArgs,
pub incoming: Incoming,
}Expand description
The context arguments passed to the driver in its start arguments.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.root_dispatcher: DispatcherRef<'static>A reference to the root [fdf::Dispatcher] for this driver.
start_args: DriverStartArgsThe original DriverStartArgs passed in as start arguments, minus any parts that were
used to construct other elements of Self.
incoming: IncomingThe 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 take_config<C: Config>(&mut self) -> Result<C, Status>
pub fn take_config<C: Config>(&mut self) -> Result<C, Status>
Returns the component config.
After calling this, DriverStartArgs::config in Self::start_args will be None.
Returns [Status::INVALID_ARGS] if the config 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.
Sourcepub fn publish_inspect(
&self,
inspector: &Inspector,
scope: ScopeHandle,
) -> Result<(), Status>
pub fn publish_inspect( &self, inspector: &Inspector, scope: ScopeHandle, ) -> Result<(), Status>
Spawns a server handling fuchsia.inspect.Tree requests and a handle
to the fuchsia.inspect.Tree is published using fuchsia.inspect.InspectSink.
Whenever the client wishes to stop publishing Inspect, the Controller may be dropped.
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self§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