pub struct YamlProjectRegistry;Expand description
A ProjectRegistry backed by projects.yml in the user’s config directory
(~/.config/muster/projects.yml on Linux). A project’s config path may
begin with ~; ambiguous legacy relative paths are rejected.
Trait Implementations§
Source§impl Default for YamlProjectRegistry
impl Default for YamlProjectRegistry
Source§fn default() -> YamlProjectRegistry
fn default() -> YamlProjectRegistry
Returns the “default value” for a type. Read more
Source§impl ProjectRegistry for YamlProjectRegistry
impl ProjectRegistry for YamlProjectRegistry
Source§fn projects(&self) -> Result<Vec<Project>, ConfigError>
fn projects(&self) -> Result<Vec<Project>, ConfigError>
The registered projects, in file order. A missing registry yields an
empty list rather than an error. Read more
Source§fn workspace(&self, config_path: &Path) -> Result<WorkspaceConfig, ConfigError>
fn workspace(&self, config_path: &Path) -> Result<WorkspaceConfig, ConfigError>
Loads the workspace configuration at
config_path. Read moreSource§fn workspace_exists(&self, config_path: &Path) -> bool
fn workspace_exists(&self, config_path: &Path) -> bool
Whether a workspace config already exists at
config_path.Source§fn save(&self, projects: &[Project]) -> Result<(), ConfigError>
fn save(&self, projects: &[Project]) -> Result<(), ConfigError>
Persists the full project list, replacing the registry file. Read more
Source§fn save_workspace(
&self,
config_path: &Path,
config: &WorkspaceConfig,
) -> Result<(), ConfigError>
fn save_workspace( &self, config_path: &Path, config: &WorkspaceConfig, ) -> Result<(), ConfigError>
Source§fn create_workspace(
&self,
config_path: &Path,
config: &WorkspaceConfig,
) -> Result<bool, ConfigError>
fn create_workspace( &self, config_path: &Path, config: &WorkspaceConfig, ) -> Result<bool, ConfigError>
Creates the workspace at
config_path only when nothing exists there.
Returns whether this call created the file. The default checks then
writes; a filesystem-backed adapter should override it with an atomic
exclusive create so a concurrent creation is never overwritten. Read moreSource§fn update_projects(
&self,
update: &mut dyn FnMut(Vec<Project>) -> Vec<Project>,
) -> Result<(), ConfigError>
fn update_projects( &self, update: &mut dyn FnMut(Vec<Project>) -> Vec<Project>, ) -> Result<(), ConfigError>
Applies
update to the project list under the registry’s exclusive lock
where the implementation provides one, so concurrent mutations serialize
instead of losing writes. Read moreSource§fn update_workspace(
&self,
config_path: &Path,
update: &mut dyn FnMut(WorkspaceConfig) -> WorkspaceConfig,
) -> Result<(), ConfigError>
fn update_workspace( &self, config_path: &Path, update: &mut dyn FnMut(WorkspaceConfig) -> WorkspaceConfig, ) -> Result<(), ConfigError>
Reads the workspace at
config_path, applies update, and writes it
back as a single operation, so concurrent updates to the same project
(for example two muster run invocations) cannot lose each other. The
default is an unlocked read-modify-write; a filesystem-backed adapter
should override this to hold an exclusive lock across the whole sequence. Read moreAuto Trait Implementations§
impl Freeze for YamlProjectRegistry
impl RefUnwindSafe for YamlProjectRegistry
impl Send for YamlProjectRegistry
impl Sync for YamlProjectRegistry
impl Unpin for YamlProjectRegistry
impl UnsafeUnpin for YamlProjectRegistry
impl UnwindSafe for YamlProjectRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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>
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