pub struct AuthorBuilder { /* private fields */ }
Expand description
Implementation of the builder pattern for the Author struct
.
§Description
Use this object to partially build an Author object. For example:
use lacoctelera::domain::{Author, AuthorBuilder};
let author = AuthorBuilder::default()
.set_name("Jane")
.set_surname("Doe")
.set_shareable(true)
.build().unwrap();
AuthorBuilder::build shall be called after all the member initializations. This method returns a Result if some of the values given to the constructor don’t comply with the restrictions defined to Author’s members.
Implementations§
Source§impl AuthorBuilder
impl AuthorBuilder
pub fn set_id(self, id: &str) -> Self
pub fn set_name(self, name: &str) -> Self
pub fn set_surname(self, surname: &str) -> Self
pub fn set_email(self, email: &str) -> Self
pub fn set_description(self, description: &str) -> Self
pub fn set_website(self, website: &str) -> Self
pub fn build(self) -> Result<Author, DataDomainError>
Trait Implementations§
Source§impl Default for AuthorBuilder
impl Default for AuthorBuilder
Source§fn default() -> AuthorBuilder
fn default() -> AuthorBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuthorBuilder
impl RefUnwindSafe for AuthorBuilder
impl Send for AuthorBuilder
impl Sync for AuthorBuilder
impl Unpin for AuthorBuilder
impl UnwindSafe for AuthorBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more