ExampleBuilder

Struct ExampleBuilder 

Source
pub struct ExampleBuilder<S: State = Empty> { /* private fields */ }
Expand description

Showcases examples of #[builder(default)] usage and what docs are generated for them. Click on any of source links to see the source code.

Implementations§

Source§

impl<S: State> ExampleBuilder<S>

Source

pub fn build(self) -> Example
where S: IsComplete,

Finish building and return the requested object

Source

pub fn small_custom_default( self, value: u32, ) -> ExampleBuilder<SetSmallCustomDefault<S>>
where S::SmallCustomDefault: IsUnset,

Optional (Some / Option setters). Default: (2 + 2) * 10.

Source

pub fn maybe_small_custom_default( self, value: Option<u32>, ) -> ExampleBuilder<SetSmallCustomDefault<S>>
where S::SmallCustomDefault: IsUnset,

Optional (Some / Option setters). Default: (2 + 2) * 10.

Source

pub fn big_custom_default( self, value: Vec<Point>, ) -> ExampleBuilder<SetBigCustomDefault<S>>
where S::BigCustomDefault: IsUnset,

Optional (Some / Option setters). Default:

Vec::from([
    Point { x: 1, y: 2 },
    Point { x: 3, y: 4 },
    Point { x: 5, y: 6 },
    Point { x: 7, y: 8 },
])
Source

pub fn maybe_big_custom_default( self, value: Option<Vec<Point>>, ) -> ExampleBuilder<SetBigCustomDefault<S>>
where S::BigCustomDefault: IsUnset,

Optional (Some / Option setters). Default:

Vec::from([
    Point { x: 1, y: 2 },
    Point { x: 3, y: 4 },
    Point { x: 5, y: 6 },
    Point { x: 7, y: 8 },
])
Source

pub fn standard_u32_default( self, value: u32, ) -> ExampleBuilder<SetStandardU32Default<S>>
where S::StandardU32Default: IsUnset,

Optional (Some / Option setters). Default: 0.

Source

pub fn maybe_standard_u32_default( self, value: Option<u32>, ) -> ExampleBuilder<SetStandardU32Default<S>>
where S::StandardU32Default: IsUnset,

Optional (Some / Option setters). Default: 0.

Source

pub fn standard_string_default( self, value: String, ) -> ExampleBuilder<SetStandardStringDefault<S>>
where S::StandardStringDefault: IsUnset,

Optional (Some / Option setters). Default: "".

Source

pub fn maybe_standard_string_default( self, value: Option<String>, ) -> ExampleBuilder<SetStandardStringDefault<S>>
where S::StandardStringDefault: IsUnset,

Optional (Some / Option setters). Default: "".

Auto Trait Implementations§

§

impl<S> Freeze for ExampleBuilder<S>

§

impl<S> RefUnwindSafe for ExampleBuilder<S>

§

impl<S> Send for ExampleBuilder<S>

§

impl<S> Sync for ExampleBuilder<S>

§

impl<S> Unpin for ExampleBuilder<S>

§

impl<S> UnwindSafe for ExampleBuilder<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.