use super::structure::Contact;
pub struct ContactBuilder {
homepage: Option<String>,
}
impl ContactBuilder {
pub fn new() -> Self {
ContactBuilder { homepage: None }
}
pub fn homepage(mut self, homepage: String) -> Self {
self.homepage = Some(homepage);
self
}
pub fn build(self) -> Result<Contact, &'static str> {
Ok(Contact {
homepage: self.homepage,
})
}
}
impl Default for ContactBuilder {
fn default() -> Self {
Self::new()
}
}