pub struct ProjectAnalyzer { /* private fields */ }Expand description
Analyzer for detecting project conventions and patterns.
Implementations§
Source§impl ProjectAnalyzer
impl ProjectAnalyzer
Sourcepub fn current_dir() -> Self
pub fn current_dir() -> Self
Create an analyzer for the current working directory.
Sourcepub fn analyze(&self) -> ProjectConventions
pub fn analyze(&self) -> ProjectConventions
Analyze the project structure and return detected conventions.
Sourcepub fn list_models(&self) -> Vec<String>
pub fn list_models(&self) -> Vec<String>
List all existing model names (snake_case) in the project.
Sourcepub fn model_exists(&self, name: &str) -> bool
pub fn model_exists(&self, name: &str) -> bool
Check if a model exists in the project (case-insensitive).
Sourcepub fn detect_foreign_keys(
&self,
fields: &[(&str, &str)],
) -> Vec<ForeignKeyInfo>
pub fn detect_foreign_keys( &self, fields: &[(&str, &str)], ) -> Vec<ForeignKeyInfo>
Detect foreign key relationships from a list of fields.
Fields ending in _id are considered potential foreign keys.
Returns information about each detected FK including whether
the target model exists in the project.
Auto Trait Implementations§
impl Freeze for ProjectAnalyzer
impl RefUnwindSafe for ProjectAnalyzer
impl Send for ProjectAnalyzer
impl Sync for ProjectAnalyzer
impl Unpin for ProjectAnalyzer
impl UnsafeUnpin for ProjectAnalyzer
impl UnwindSafe for ProjectAnalyzer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more