mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
13 lines
555 B
Rust
13 lines
555 B
Rust
use crate::*;
|
|
|
|
/// Implement [TryFrom<&Arc<RwLock<JackConnection>>>]: create app state from wrapped JACK handle.
|
|
#[macro_export] macro_rules! from_jack {
|
|
(|$jack:ident|$Struct:ident$(<$($L:lifetime),*$($T:ident$(:$U:path)?),*>)? $cb:expr) => {
|
|
impl $(<$($L),*$($T $(: $U)?),*>)? TryFrom<&Arc<RwLock<JackConnection>>> for $Struct $(<$($L),*$($T),*>)? {
|
|
type Error = Box<dyn std::error::Error>;
|
|
fn try_from ($jack: &Arc<RwLock<JackConnection>>) -> Usually<Self> {
|
|
Ok($cb)
|
|
}
|
|
}
|
|
};
|
|
}
|