pub struct Emulator { /* private fields */ }
Expand description
Represents a bt-hci device emulator. Instances of this type can be used manage the
bt-hci-emulator driver within the test device hierarchy. The associated driver instance gets
unbound and all bt-hci and bt-emulator device instances destroyed when
destroy_and_wait()
resolves successfully.
destroy_and_wait()
MUST be called for proper clean up of the emulator device.
Implementations§
Source§impl Emulator
impl Emulator
Sourcepub fn default_settings() -> EmulatorSettings
pub fn default_settings() -> EmulatorSettings
Returns the default settings.
Sourcepub async fn create(dev_directory: DirectoryProxy) -> Result<Emulator, Error>
pub async fn create(dev_directory: DirectoryProxy) -> Result<Emulator, Error>
Publish a new bt-emulator device and return a handle to it. No corresponding bt-hci device
will be published; to do so it must be explicitly configured and created with a call to
publish()
. If realm
is present, the device will be created inside it, otherwise it will
be created using the /dev
directory in the component’s namespace.
Sourcepub async fn create_and_publish(
dev_directory: DirectoryProxy,
) -> Result<Emulator, Error>
pub async fn create_and_publish( dev_directory: DirectoryProxy, ) -> Result<Emulator, Error>
Publish a bt-emulator and a bt-hci device using the default emulator settings. If realm
is present, the device will be created inside it, otherwise it will be created using the
/dev
directory in the component’s namespace.
Sourcepub async fn publish(&self, settings: EmulatorSettings) -> Result<(), Error>
pub async fn publish(&self, settings: EmulatorSettings) -> Result<(), Error>
Sends a publish message to the emulator. This is a convenience method that internally handles the FIDL binding error.
pub async fn publish_and_wait_for_device_path( &self, settings: EmulatorSettings, ) -> Result<String, Error>
Sourcepub async fn destroy_and_wait(&mut self) -> Result<(), Error>
pub async fn destroy_and_wait(&mut self) -> Result<(), Error>
Sends the test device a destroy message which will unbind the driver. This will wait for the test device to be unpublished from devfs.
pub async fn get_topological_path(&self) -> Result<String, Error>
pub fn emulator(&self) -> &EmulatorProxy
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Emulator
impl !RefUnwindSafe for Emulator
impl Send for Emulator
impl Sync for Emulator
impl Unpin for Emulator
impl !UnwindSafe for Emulator
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