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

[Feature] (Bonsai SDK) Missing trait instances for SessionId #1358

Closed
intoverflow opened this issue Jan 20, 2024 · 0 comments · Fixed by #1382
Closed

[Feature] (Bonsai SDK) Missing trait instances for SessionId #1358

intoverflow opened this issue Jan 20, 2024 · 0 comments · Fixed by #1382
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@intoverflow
Copy link
Member

Feature

Add trait instances for Eq, Deserialize, and Serialize to SessionId.

Motivation

The missing Eq trait seems like an oversight. The type already implements PartialEq, and semantically it makes sense for ID types to support equality checking.

The missing Deserialize and Serialize traits also seem like an oversight. For end users, SessionId is the sort of thing they might want to persist to disk or database. Right now the only way to do this is to serialize the session's uuid field, then deserialize with the help of SessionId::new(). This works, but it's somewhat abstraction-breaking, and it's not clear that there's a downside to providing the Serde traits.

Implementation

Add the traits to the #[derive(..)] directive.

@intoverflow intoverflow added the enhancement New feature or request label Jan 20, 2024
@flaub flaub changed the title [Feature] (Bonsai SKD) Missing trait instances for SessionId [Feature] (Bonsai SDK) Missing trait instances for SessionId Jan 23, 2024
@flaub flaub added this to the 0.20.0 milestone Jan 26, 2024
@flaub flaub self-assigned this Jan 26, 2024
flaub added a commit that referenced this issue Jan 26, 2024
flaub added a commit that referenced this issue Jan 26, 2024
flaub added a commit that referenced this issue Jan 26, 2024
flaub added a commit that referenced this issue Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants