pub struct SqlFileDoc { /* private fields */ }Expand description
Structure for containing the docs for every Table in an .sql file as a
Vec of TableDoc
Implementations§
Source§impl SqlFileDoc
impl SqlFileDoc
Sourcepub fn from_parsed_file(
file: &ParsedSqlFile,
comments: &Comments,
capture: LeadingCommentCapture,
flatten: MultiFlatten<'_>,
) -> Result<Self, DocError>
pub fn from_parsed_file( file: &ParsedSqlFile, comments: &Comments, capture: LeadingCommentCapture, flatten: MultiFlatten<'_>, ) -> Result<Self, DocError>
Final structured documentation extracted from one SQL file.
This merges:
- Parsed SQL AST (
CREATE TABLEstatements for example) - Comment spans into a format suitable for documentation generation.
§Parameters
file: theParsedSqlFilecomments: the parsedComments
§Errors
- Returns
DocError::InvalidObjectNameif the table name has no identifier components. - May also propagate other
DocErrorvariants from lower layers in the future.
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 vec
Sourcepub fn number_of_tables(&self) -> usize
pub fn number_of_tables(&self) -> usize
Returns the number fo tables in the SqlFileDoc
Trait Implementations§
Source§impl Clone for SqlFileDoc
impl Clone for SqlFileDoc
Source§fn clone(&self) -> SqlFileDoc
fn clone(&self) -> SqlFileDoc
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SqlFileDoc
impl Debug for SqlFileDoc
Source§impl From<SqlFileDoc> for Vec<TableDoc>
Converts a file doc into its table docs (consumes the SqlFileDoc).
impl From<SqlFileDoc> for Vec<TableDoc>
Converts a file doc into its table docs (consumes the SqlFileDoc).
Source§fn from(value: SqlFileDoc) -> Self
fn from(value: SqlFileDoc) -> Self
Converts to this type from the input type.
Source§impl IntoIterator for SqlFileDoc
impl IntoIterator for SqlFileDoc
Source§impl PartialEq for SqlFileDoc
impl PartialEq for SqlFileDoc
impl Eq for SqlFileDoc
impl StructuralPartialEq for SqlFileDoc
Auto Trait Implementations§
impl Freeze for SqlFileDoc
impl RefUnwindSafe for SqlFileDoc
impl Send for SqlFileDoc
impl Sync for SqlFileDoc
impl Unpin for SqlFileDoc
impl UnwindSafe for SqlFileDoc
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