pub enum DriverRequest {
Start {
start_args: DriverStartArgs,
responder: DriverStartResponder,
},
Stop {},
_UnknownMethod {
ordinal: u64,
method_type: MethodType,
},
}
Expand description
This protocol is used by the Driver Framework’s Driver Host to communicate various messages and
lifecycle hooks to the driver. The connection for this protocol is established through the
|DriverRegistration| defined in the driver_symbols
library.
Once the driver has closed its server end, the Driver Framework will initiate the shutdown of all dispatchers belonging to this driver.
Variants§
Start
Starts the driver with the given |start_args|.
Drivers should finish their initial setup and enumeration before returning from |Start|.
In particular they should enumerate all currently available nodes by utilizing
fuchsia.driver.framework/Node.AddChild
and waiting for all calls to be completed.
The Framework will not consider the driver to be started until this call has returned successfully. Therefore a driver will not have |Stop| called on it until after it has replied to |Start| successfully.
If a driver returns an error, it will not have |Stop| called on it before the Driver Framework initiates shutdown of the driver’s dispatchers. Therefore it should have performed all necessary cleanup before returning an error.
Stop
Stops the driver. To stop, the driver should teardown any resources it set up in or after |Start|. This is a one-way FIDL method. When the driver has completed stopping, it should close its server end. Asynchronous operations should fully complete before closing the server end.
_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
method_type: MethodType
Implementations§
Source§impl DriverRequest
impl DriverRequest
pub fn into_start(self) -> Option<(DriverStartArgs, DriverStartResponder)>
pub fn into_stop(self) -> Option<()>
pub fn new_start(self, start_args: DriverStartArgs, tx_id: u32) -> Self
pub fn new_stop(self) -> Self
pub fn start_as_message( arena: Arena, start_args: DriverStartArgs, tx_id: u32, ) -> Result<Message<[u8]>, Error>
pub fn stop_as_message(arena: Arena) -> Result<Message<[u8]>, Error>
pub fn read_from( bytes: &[u8], _handles: &mut [HandleInfo], ) -> Result<Self, Error>
pub fn read_from_message(message: Message<[u8]>) -> Result<(Arena, Self), Error>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Source§impl Debug for DriverRequest
impl Debug for DriverRequest
Source§impl TryFrom<Message<[u8]>> for DriverRequest
impl TryFrom<Message<[u8]>> for DriverRequest
Like DriverRequest::read_from_message
except it drops the [Arena
].