Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arc & Mutex (and RwLock, RC, RefCell) #136

Open
HHogg opened this issue Jul 17, 2023 · 1 comment
Open

Arc & Mutex (and RwLock, RC, RefCell) #136

HHogg opened this issue Jul 17, 2023 · 1 comment

Comments

@HHogg
Copy link

HHogg commented Jul 17, 2023

#[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;
@HHogg HHogg changed the title Arc & Mutex Arc & Mutex (and RwLock, RC, RefCell) Jul 17, 2023
@HHogg
Copy link
Author

HHogg commented Jul 18, 2023

I've just seen #134 nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant