Trait Builder

Source
pub trait Builder<B: Sized>: Sized {
    // Required methods
    fn with_field<T: 'static>(
        self,
        field_name: &'static str,
        field_value: T,
    ) -> Self;
    fn with_field_at<T: 'static>(
        self,
        field_index: usize,
        field_value: T,
    ) -> Self;
    fn try_build(self) -> Result<B, ()>;

    // Provided method
    fn build(self) -> B { ... }
}

Required Methods§

Source

fn with_field<T: 'static>( self, field_name: &'static str, field_value: T, ) -> Self

Source

fn with_field_at<T: 'static>(self, field_index: usize, field_value: T) -> Self

Source

fn try_build(self) -> Result<B, ()>

Provided Methods§

Source

fn build(self) -> B

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§