typeshare
typeshare copied to clipboard
Arc & Mutex (and RwLock, RC, RefCell)
#[derive(Serialize)]
#[typeshare]
struct MyStruct {
arc_mutex: Arc<Mutex<SomeOtherStruct>>,
box: Box<SomeOtherStruct>
}
The above currently outputs (in typescript)
export interface MyStruct {
arc_mutex: Arc<Mutex<SomeOtherStruct>>,
box: SomeOtherStruct,
}
Similar to how Box is handled, should typeshare omit Arc and Mutex from the output? (serde
automatically handles this too).
I'm working around this like...
#![allow(unused)]
use typeshare::typeshare;
#[typeshare]
type Arc<T> = T;
#[typeshare]
type Mutex<T> = T;
#[typeshare]
type RwLock<T> = T;
I've just seen #134 nice!