You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
flaub
changed the title
[Feature] (Bonsai SKD) Missing trait instances for SessionId
[Feature] (Bonsai SDK) Missing trait instances for SessionId
Jan 23, 2024
Feature
Add trait instances for
Eq
,Deserialize
, andSerialize
to SessionId.Motivation
The missing
Eq
trait seems like an oversight. The type already implementsPartialEq
, and semantically it makes sense for ID types to support equality checking.The missing
Deserialize
andSerialize
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'suuid
field, then deserialize with the help ofSessionId::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.The text was updated successfully, but these errors were encountered: