AudioSetup now stores children as OnOff instead of Device as that is all that is required
This commit is contained in:
@@ -5,11 +5,15 @@ macro_rules! impl_cast {
|
||||
($base:ident, $trait:ident) => {
|
||||
$crate::paste::paste! {
|
||||
pub trait [< As $trait>] {
|
||||
fn consume(self: Box<Self>) -> Option<Box<dyn $trait + Sync + Send>>;
|
||||
fn cast(&self) -> Option<&dyn $trait>;
|
||||
fn cast_mut(&mut self) -> Option<&mut dyn $trait>;
|
||||
}
|
||||
|
||||
impl<T: $base> [< As $trait>] for T {
|
||||
default fn consume(self: Box<Self>) -> Option<Box<dyn $trait + Sync + Send>> {
|
||||
None
|
||||
}
|
||||
default fn cast(&self) -> Option<&dyn $trait> {
|
||||
None
|
||||
}
|
||||
@@ -18,7 +22,10 @@ macro_rules! impl_cast {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: $base + $trait> [< As $trait>] for T {
|
||||
impl<T: $base + $trait + Sync + Send + 'static> [< As $trait>] for T {
|
||||
fn consume(self: Box<Self>) -> Option<Box<dyn $trait + Sync + Send>> {
|
||||
Some(self)
|
||||
}
|
||||
fn cast(&self) -> Option<&dyn $trait> {
|
||||
Some(self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user