EntBuilder

Trait EntBuilder 

Source
pub trait EntBuilder {
    type Output: Ent;
    type Error;

    // Required methods
    fn finish(self) -> Result<Self::Output, Self::Error>;
    fn finish_and_commit(
        self,
    ) -> Result<DatabaseResult<Self::Output>, Self::Error>;
}
Expand description

Represents a builder interface for some ent, capable of building a new ent instance and also saving the new ent to the database at the same time

Required Associated Types§

Source

type Output: Ent

The ent that will be created

Source

type Error

The ent-specific builder errors that can occur

Required Methods§

Source

fn finish(self) -> Result<Self::Output, Self::Error>

Consumes the builder and creates a new instance of the ent

Source

fn finish_and_commit(self) -> Result<DatabaseResult<Self::Output>, Self::Error>

Consumes the builder, creates a new instance of the ent, and saves it to the database referenced by the ent

Implementors§