Prima bridge pattern implementation for rust
```rust use serde::Deserialize; use primabridge::prelude::*; use oncecell::sync::OnceCell;
pub struct MyCustomData { name: String }
// using OnceCell we make sure that Bridge
gets instantiated only once
fn bridge() -> &'static Bridge {
static BRIDGE: OnceCell
pub fn fetchdata() -> Result
fn main() {
let data = fetch_data().expect("there was an error while fetching data");
println!("the name is {}", data.name);
}
```
To understand this example you should know: - once_cell library providing the cell type - Rust error handling to use ? and convert it to a custom error type. See for example thiserror