Macro flutter_rust_bridge::opaque_dyn
source · macro_rules! opaque_dyn { ($ex:expr) => { ... }; }
Expand description
Macro helper to instantiate an RustOpaque<dyn Trait>
, as Rust does not
support custom DSTs on stable.
Example:
use std::fmt::Debug;
use flutter_rust_bridge::*;
pub trait MyDebug: DartSafe + Debug {}
impl<T: DartSafe + Debug> MyDebug for T {}
let opaque: RustOpaque<Box<dyn MyDebug>> = opaque_dyn!("foobar");