pub struct ProjectService { /* private fields */ }Implementations§
Source§impl ProjectService
impl ProjectService
Sourcepub fn detect(path: &Path) -> Result<ProjectService, Error>
pub fn detect(path: &Path) -> Result<ProjectService, Error>
Detect a Mecha10 project by searching upward from path for mecha10.json.
Sourcepub fn new(path: PathBuf) -> ProjectService
pub fn new(path: PathBuf) -> ProjectService
Create a ProjectService for path without generating project files;
use the init handler to actually create them.
Sourcepub fn config_path(&self) -> PathBuf
pub fn config_path(&self) -> PathBuf
Get the path to mecha10.json
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if a mecha10.json exists at the project root
Sourcepub fn name(&self) -> Result<String, Error>
pub fn name(&self) -> Result<String, Error>
Get project name from metadata
Tries mecha10.json first, then falls back to Cargo.toml
Sourcepub fn version(&self) -> Result<String, Error>
pub fn version(&self) -> Result<String, Error>
Get project version from metadata
Tries mecha10.json first, then falls back to Cargo.toml
Sourcepub fn load_metadata(&self) -> Result<(String, String), Error>
pub fn load_metadata(&self) -> Result<(String, String), Error>
Load project metadata (name and version)
Tries mecha10.json first, then falls back to Cargo.toml
Sourcepub fn validate(&self) -> Result<(), Error>
pub fn validate(&self) -> Result<(), Error>
Validate project structure
Checks that required directories and files exist.
Sourcepub fn list_nodes(&self) -> Result<Vec<String>, Error>
pub fn list_nodes(&self) -> Result<Vec<String>, Error>
List all nodes in the project
Returns a list of node names found in the nodes/ directory.
Sourcepub fn list_drivers(&self) -> Result<Vec<String>, Error>
pub fn list_drivers(&self) -> Result<Vec<String>, Error>
List all drivers in the project
Returns a list of driver names found in the drivers/ directory.
Sourcepub fn list_types(&self) -> Result<Vec<String>, Error>
pub fn list_types(&self) -> Result<Vec<String>, Error>
List all custom types in the project
Returns a list of type names found in the types/ directory.
Auto Trait Implementations§
impl Freeze for ProjectService
impl RefUnwindSafe for ProjectService
impl Send for ProjectService
impl Sync for ProjectService
impl Unpin for ProjectService
impl UnsafeUnpin for ProjectService
impl UnwindSafe for ProjectService
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
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> ⓘ
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> ⓘ
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