We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Since PR: #221, typeshare correctly translates struct generics in Go. The following Rust snippet:
#[typeshare] pub(crate) struct ItemsGetAllResponse { pub(crate) individual_responses: Vec<Response<Item, Error>>, } #[typeshare] pub(crate) struct Response<T, E> { pub(crate) content: Option<T>, pub(crate) error: Option<E>, }
Correctly translates to:
type Response[T any, E any] struct { Content *T `json:"content,omitempty"` Error *E `json:"error,omitempty"` } type ItemsGetAllResponse struct { IndividualResponses []IndividualResponse[Item, Error] `json:"individualResponses"` }
However, generic bounds aren't supported:
#[typeshare] pub(crate) struct IndividualResponse<T: Item, E: Error> { pub(crate) content: Option<T>, pub(crate) error: Option<E>, }
doesn't translate to
type Response[T Item, E Error] struct { Content *T `json:"content,omitempty"` Error *E `json:"error,omitempty"` }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
📰 Overview
Since PR: #221, typeshare correctly translates struct generics in Go.
The following Rust snippet:
Correctly translates to:
However, generic bounds aren't supported:
doesn't translate to
The text was updated successfully, but these errors were encountered: