pub struct ConfigService;Implementations§
Source§impl ConfigService
impl ConfigService
Sourcepub async fn load_from(path: &Path) -> Result<ProjectConfig, Error>
pub async fn load_from(path: &Path) -> Result<ProjectConfig, Error>
Load project configuration from a specific mecha10.json path.
Errors if the file is missing, unreadable, or fails to parse/validate.
Sourcepub fn find_config() -> Result<PathBuf, Error>
pub fn find_config() -> Result<PathBuf, Error>
Find mecha10.json by searching upward from the current working directory.
Sourcepub fn find_config_from(start_dir: &Path) -> Result<PathBuf, Error>
pub fn find_config_from(start_dir: &Path) -> Result<PathBuf, Error>
Find mecha10.json by searching upward from start_dir.
Sourcepub fn is_initialized(dir: &Path) -> bool
pub fn is_initialized(dir: &Path) -> bool
Check if dir contains a mecha10.json
Sourcepub fn is_initialized_here() -> bool
pub fn is_initialized_here() -> bool
Check if a project is initialized in the current directory
Sourcepub async fn load_robot_id(path: &Path) -> Result<String, Error>
pub async fn load_robot_id(path: &Path) -> Result<String, Error>
Load just the robot ID from the mecha10.json at path.
Sourcepub fn validate(path: &Path) -> Result<(), Error>
pub fn validate(path: &Path) -> Result<(), Error>
Validate the configuration file at path against the mecha10-core schema.
Sourcepub fn resolve_and_validate(path: Option<&Path>) -> Result<PathBuf, Error>
pub fn resolve_and_validate(path: Option<&Path>) -> Result<PathBuf, Error>
Resolve the config file to validate and validate it – shared by mecha10 config validate
and mecha10 lint. None validates the project’s mecha10.json plus every node config
it references; Some validates exactly that one file.
Auto Trait Implementations§
impl Freeze for ConfigService
impl RefUnwindSafe for ConfigService
impl Send for ConfigService
impl Sync for ConfigService
impl Unpin for ConfigService
impl UnsafeUnpin for ConfigService
impl UnwindSafe for ConfigService
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