pub struct ConfigService;Implementations§
Source§impl ConfigService
impl ConfigService
Sourcepub async fn load_from(path: &Path) -> Result<ProjectConfig>
pub async fn load_from(path: &Path) -> Result<ProjectConfig>
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>
pub fn find_config() -> Result<PathBuf>
Find mecha10.json by searching upward from the current working directory.
Sourcepub fn find_config_from(start_dir: &Path) -> Result<PathBuf>
pub fn find_config_from(start_dir: &Path) -> Result<PathBuf>
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>
pub async fn load_robot_id(path: &Path) -> Result<String>
Load just the robot ID from the mecha10.json at path.
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