New features: serde support, and conversions to uuid
abreis opened this issue · comments
Andre B. Reis commented
Hi, I wrote two new (optional) features in my own fork of ulid-rs
, and I'd like to know if you'd welcome pull requests for either of them. They are:
- serde: this pulls in
serde
and implementsSerialize
andDeserialize
forUlid
. The 26-char representation is used by default, and I also wrote a module that can serialize as the inner primitiveu128
by annotating structs with#[serde(with = "ulid_as_u128")]
; - uuid: this is a tiny convenience feature that pulls in the
uuid
crate and implements the conversionsFrom<Uuid> for Ulid
andFrom<Ulid> for Uuid
, both infallible. These come in handy when interacting with systems that expect UUIDs.
Dylan Hart commented
These sound great. When making the PR can you put them behind non-default feature flags?