Struct wasapi::EventCallbacks

source ·
pub struct EventCallbacks { /* private fields */ }
Expand description

A structure holding the callbacks for notifications

Implementations§

source§

impl EventCallbacks

source

pub fn new() -> Self

Create a new EventCallbacks with no callbacks set

source

pub fn set_simple_volume_callback( &mut self, c: impl Fn(f32, bool, GUID) + 'static, )

Set a callback for OnSimpleVolumeChanged notifications

source

pub fn unset_simple_volume_callback(&mut self)

Remove a callback for OnSimpleVolumeChanged notifications

source

pub fn set_channel_volume_callback( &mut self, c: impl Fn(usize, f32, GUID) + 'static, )

Set a callback for OnChannelVolumeChanged notifications

source

pub fn unset_channel_volume_callback(&mut self)

Remove a callback for OnChannelVolumeChanged notifications

source

pub fn set_disconnected_callback( &mut self, c: impl Fn(DisconnectReason) + 'static, )

Set a callback for OnSessionDisconnected notifications

source

pub fn unset_disconnected_callback(&mut self)

Remove a callback for OnSessionDisconnected notifications

source

pub fn set_state_callback(&mut self, c: impl Fn(SessionState) + 'static)

Set a callback for OnStateChanged notifications

source

pub fn unset_state_callback(&mut self)

Remove a callback for OnStateChanged notifications

source

pub fn set_iconpath_callback(&mut self, c: impl Fn(String, GUID) + 'static)

Set a callback for OnIconPathChanged notifications

source

pub fn unset_iconpath_callback(&mut self)

Remove a callback for OnIconPathChanged notifications

source

pub fn set_displayname_callback(&mut self, c: impl Fn(String, GUID) + 'static)

Set a callback for OnDisplayNameChanged notifications

source

pub fn unset_displayname_callback(&mut self)

Remove a callback for OnDisplayNameChanged notifications

source

pub fn set_groupingparam_callback(&mut self, c: impl Fn(GUID, GUID) + 'static)

Set a callback for OnGroupingParamChanged notifications

source

pub fn unset_groupingparam_callback(&mut self)

Remove a callback for OnGroupingParamChanged notifications

Trait Implementations§

source§

impl Default for EventCallbacks

source§

fn default() -> Self

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

Auto Trait Implementations§

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>,

§

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>,

§

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.