Open
Description
Hi,
I like your library a lot and I use it regularly.
Today I tried to use serde
attributes on my new-type struct but failed. Here is an example:
#[nutype(
validate(predicate = |token| !token.is_empty()),
derive(Debug, Serialize, Deserialize, AsRef, Deref, TryFrom),
)]
#[serde(serialize_with = "...", deserialize_with = "...")]
pub struct InvitationToken(Vec<u8>);
The compiler says error: #[nutype] does not support this attribute.
. I also tried this one:
#[nutype(
validate(predicate = |token| !token.is_empty()),
derive(Debug, Serialize, Deserialize, AsRef, Deref, TryFrom),
)]
pub struct InvitationToken(#[serde(serialize_with = "...", deserialize_with = "...")] Vec<u8>);
As I understand, this is unsupported yet. Am I right?
Metadata
Assignees
Labels
No labels
Activity