Skip to main content

Asio

Struct Asio 

Source
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

Source

pub fn new() -> Self

Initialise the ASIO API.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Asio

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Asio

Source§

fn default() -> Asio

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl !Freeze for Asio

§

impl RefUnwindSafe for Asio

§

impl Send for Asio

§

impl Sync for Asio

§

impl Unpin for Asio

§

impl UnwindSafe for Asio

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.