Struct fluent_builder::StatefulFluentBuilder [] [src]

pub struct StatefulFluentBuilder<T, S> { /* fields omitted */ }

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

Methods

impl<T, S> StatefulFluentBuilder<T, S>
[src]

[src]

Create a new StatefulFlientBuilder from the given value.

[src]

Create a new StatefulFlientBuilder from the given seed.

[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, S> StatefulFluentBuilder<T, S> where
    T: 'static,
    S: 'static, 
[src]

[src]

Create a new StatefulFlientBuilder from the given seed and fluent method.

[src]

Create a new StatefulFlientBuilder from the given seed and fluent method.

This method is the same as from_fluent, but mutates the value instead of replacing it.

[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.