Processor

Struct Processor 

Source
pub struct Processor<'a> { /* private fields */ }
Expand description

DML processor and SQL generator

Collects DBObject’s and creates SQL sql_statements using the supplied TypeWriter or Postgresql if none is provided

Implementations§

Source§

impl<'a> Processor<'a>

Source

pub fn new(type_writer: Option<Box<dyn TypeWriter>>) -> Self

Create a new Processor optionally specifying a TypeWriter to use

Source

pub fn new_with_objects( objects: &'a Vec<Box<dyn DBObject>>, type_writer: Option<Box<dyn TypeWriter>>, ) -> Self

Create a new Processor optionally specifying a TypeWriter to use

Source

pub fn add(&mut self, object: &'a dyn DBObject) -> &Self

Add a DB object

Source

pub fn sql_statements(&self) -> Vec<String>

Get the list of serialized SQL sql_statements

Source

pub fn join_sql_statements(&self) -> String

Get a String with all of the SQL statments

Source

pub fn serialize_to_yaml_file( &self, file_name: &str, ) -> Result<(), Box<dyn Error>>

Write objects to a YAML file

Source

pub fn write_to_sql_file(&self, file_name: &str) -> Result<(), Box<dyn Error>>

Write generated SQL to file

Source

pub fn objects(&self) -> &Vec<Box<&'a dyn DBObject>>

Get number of objects present

Auto Trait Implementations§

§

impl<'a> Freeze for Processor<'a>

§

impl<'a> !RefUnwindSafe for Processor<'a>

§

impl<'a> !Send for Processor<'a>

§

impl<'a> !Sync for Processor<'a>

§

impl<'a> Unpin for Processor<'a>

§

impl<'a> !UnwindSafe for Processor<'a>

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.