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
It looks like that nutype has its own special derive() implementation and it can really get in the way sometimes. For example, I want to use the sqlx::Type derive, but I can't:
#[nutype( validate(not_empty, len_char_max = 20), derive(sqlx::Type),// #[nutype] does not know how to derive `sqlx` trait. sqlx(transparent))]pubstructName(String);
There's also issues regarding conditional derives: #188
Would it be possible to relax the rule and just let the user use derive directly on the type?
The text was updated successfully, but these errors were encountered:
Hi, thanks for reporting the problem.
Nutype takes a full control over derive(..) to ensure that it's not possible to derive traits that possibly can mutate value avoiding the constraints. E.g. deriving DerefMut would make a problem.
I have plans to have in-house support for Diesel and SQLx.
Would it be possible to relax the rule and just let the user use derive directly on the type?
Also I have plan to add a feature like unsafe-derive, which would allow users to derive whatever they want.
It looks like that nutype has its own special
derive()
implementation and it can really get in the way sometimes. For example, I want to use thesqlx::Type
derive, but I can't:There's also issues regarding conditional derives: #188
Would it be possible to relax the rule and just let the user use
derive
directly on the type?The text was updated successfully, but these errors were encountered: