pub struct Asio { /* private fields */ }Expand description
A handle to the ASIO API.
There should only be one instance of this type at any point in time.
Implementations§
Source§impl Asio
impl Asio
Sourcepub fn driver_names(&self) -> Vec<String>
pub fn driver_names(&self) -> Vec<String>
Returns the name for each available driver.
This is used at the start to allow the user to choose which driver they want.
Sourcepub fn loaded_driver(&self) -> Option<Driver>
pub fn loaded_driver(&self) -> Option<Driver>
If a driver has already been loaded, this will return that driver.
Returns None if no driver is currently loaded.
This can be useful to check before calling load_driver as ASIO only supports loading a
single driver at a time.
Sourcepub fn load_driver(&self, driver_name: &str) -> Result<Driver, LoadDriverError>
pub fn load_driver(&self, driver_name: &str) -> Result<Driver, LoadDriverError>
Load a driver from the given name.
Driver names compatible with this method can be produced via the asio.driver_names()
method.
NOTE: Despite many requests from users, ASIO only supports loading a single driver at a
time. Calling this method while a previously loaded Driver instance exists will result in
an error. That said, if this method is called with the name of a driver that has already
been loaded, that driver will be returned successfully.