pub struct SqlDoc { /* private fields */ }Expand description
Top-level documentation object containing all discovered TableDoc entries.
Implementations§
Source§impl SqlDoc
impl SqlDoc
Sourcepub fn from_dir<P: AsRef<Path> + ?Sized>(root: &P) -> SqlDocBuilder<'_>
pub fn from_dir<P: AsRef<Path> + ?Sized>(root: &P) -> SqlDocBuilder<'_>
Method for generating builder from a directory.
Sourcepub fn from_path<P: AsRef<Path> + ?Sized>(path: &P) -> SqlDocBuilder<'_>
pub fn from_path<P: AsRef<Path> + ?Sized>(path: &P) -> SqlDocBuilder<'_>
Method for generating builder from a Path of a single file
Sourcepub const fn from_str(content: &str) -> SqlDocBuilder<'_>
pub const fn from_str(content: &str) -> SqlDocBuilder<'_>
Creates a builder from SQL text (no filesystem path is associated) from a str
Sourcepub fn table(&self, table: &str) -> Result<&TableDoc, DocError>
pub fn table(&self, table: &str) -> Result<&TableDoc, DocError>
Method for finding a specific TableDoc by name
§Parameters
- the table
nameas astr
§Errors
- Will return
DocError::TableNotFoundif the expected table is not found - Will return
DocError::DuplicateTablesFoundif more than one table is found
Sourcepub fn table_with_schema(
&self,
schema: &str,
name: &str,
) -> Result<&TableDoc, DocError>
pub fn table_with_schema( &self, schema: &str, name: &str, ) -> Result<&TableDoc, DocError>
Method for finding a specific TableDoc from schema and table name
§Parameters
§Errors
- Will return
DocError::TableNotFoundif the expected table is not found - Will return
DocError::DuplicateTablesFoundif more than one table is found
Sourcepub fn tables_mut(&mut self) -> &mut [TableDoc]
pub fn tables_mut(&mut self) -> &mut [TableDoc]
Getter that returns a mutable reference to the TableDoc
Sourcepub fn into_tables(self) -> Vec<TableDoc>
pub fn into_tables(self) -> Vec<TableDoc>
Method to move tables out of Structure if needed
Trait Implementations§
impl Eq for SqlDoc
impl StructuralPartialEq for SqlDoc
Auto Trait Implementations§
impl Freeze for SqlDoc
impl RefUnwindSafe for SqlDoc
impl Send for SqlDoc
impl Sync for SqlDoc
impl Unpin for SqlDoc
impl UnwindSafe for SqlDoc
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more