Trait kernel::registry::RegisteredDriver
source · pub trait RegisteredDriver {
type Request: 'static;
type Response: 'static;
type Error: 'static;
type Hello: 'static;
type ConnectError: 'static;
const UUID: Uuid;
// Provided method
fn type_id() -> RegistryType { ... }
}
Expand description
A marker trait designating a registerable driver service.
Typically used with Registry::register
or Registry::register_konly
.
A connection to the service can be established using Registry::connect
,
Registry::try_connect
, Registry::connect_userspace
, or
`Registry::try_connect_userspace (depending on the service), after
the service has been registered.
Required Associated Types§
sourcetype Hello: 'static
type Hello: 'static
An initial message sent to the service by a client when establishing a connection.
This may be used by the service to route connections to specific
resources owned by that service, or to determine whether or not the
connection can be established. If the service does not require initial
data from the client, this type can be set to [()
].
sourcetype ConnectError: 'static
type ConnectError: 'static
Errors returned by the service if an incoming connection handshake is rejected.
If the service does not reject connections, this should be set to
core::convert::Infallible
.
Required Associated Constants§
Provided Methods§
sourcefn type_id() -> RegistryType
fn type_id() -> RegistryType
Get the TypeId
used to make sure that driver instances are correctly typed.
Corresponds to the same type ID as (
Self::Request
,
Self::Response
,
Self::Error
,
Self::Hello
,
Self::ConnectError
)
.