Closed rezaalavi closed 2 years ago
I would like to be able to opt-out of the setter generation for certain fields so that I can write my own setters,
Lets say I have the following struct:
#[derive(Debug, Default,Builder )] pub struct Email{ username:String, domain: String, #[builder(setter(skip))] password: String, quota: u64,
and I want to have the following code for the password setter:
impl EmailBuilder { pub fn with_password(&mut self, password: String) -> &mut Self { self.password = Some( pwhash::bcrypt::hash(password).unwrap()); self }
The current implementation for the "setter(skip)" changes the 'password' field type to "PhantomData" which is not usable.
This exists as #[builder(setter(custom))], but is not documented well (or at all?)
#[builder(setter(custom))]
I would like to be able to opt-out of the setter generation for certain fields so that I can write my own setters,
Lets say I have the following struct:
and I want to have the following code for the password setter:
The current implementation for the "setter(skip)" changes the 'password' field type to "PhantomData" which is not usable.