Struct fluent_builder::FluentBuilder [] [src]

pub struct FluentBuilder<T> { /* fields omitted */ }

A structure that can contain a value, or stack mutating methods over one supplied later.

The FluentBuilder<T> is effectively a StatefulFluentBuilder<T, ()>.

Methods

impl<T> FluentBuilder<T>
[src]

[src]

Create a default FluentBuilder.

[src]

Set a value on the builder.

This will override any contained state. That means if the builder currently contains fluent methods then those methods will be discarded.

[src]

Convert the fluent builder into a value.

This method will consume the builder and return a constructed T. This will have the following behaviour:

  • If the builder contains no value or fluent methods, then the default value is constructed.
  • If the builder contains a value, then that value is returned.
  • If the builder contains no value but fluent methods, then the methods are applied over the default value.
  • If the builder contains a value and fluent methods, then the methods are applied over that value.

impl<T> FluentBuilder<T> where
    T: 'static, 
[src]

[src]

Stack a fluent method on the builder.

This will have the following behaviour depending on the current state of the builder:

  • If there is no previous value, add the fluent method. This will be applied to a later-supplied default value.
  • If there is a previous value, add the fluent method and retain that previous value.
  • If there is a previous fluent method, stack this method on top and retain any previous value.

[src]

Stack a fluent method on the builder.

This method behaves the same as fluent, but mutates the value instead of replacing it.

Trait Implementations

impl<T> Default for FluentBuilder<T>
[src]

[src]

Returns the "default value" for a type. Read more