pub struct RepositoryManager { /* private fields */ }Expand description
Repository manager for handling multiple repositories
Implementations§
Source§impl RepositoryManager
impl RepositoryManager
Sourcepub fn from_definitions(definitions: Vec<RepositoryDefinition>) -> Self
pub fn from_definitions(definitions: Vec<RepositoryDefinition>) -> Self
Create a repository manager from a list of repository definitions Used when loading from skill-project.toml instead of repositories.toml
Sourcepub fn load(&mut self) -> Result<(), ServiceError>
pub fn load(&mut self) -> Result<(), ServiceError>
Load repositories from TOML file Loads from repositories.toml only
Sourcepub fn save(&self) -> Result<(), ServiceError>
pub fn save(&self) -> Result<(), ServiceError>
Save repositories to TOML file
Sourcepub fn add_repository(
&mut self,
name: String,
definition: RepositoryDefinition,
) -> Result<(), ServiceError>
pub fn add_repository( &mut self, name: String, definition: RepositoryDefinition, ) -> Result<(), ServiceError>
Add a new repository
Sourcepub fn remove_repository(&mut self, name: &str) -> Result<(), ServiceError>
pub fn remove_repository(&mut self, name: &str) -> Result<(), ServiceError>
Remove a repository
Sourcepub fn get_repository(&self, name: &str) -> Option<&RepositoryDefinition>
pub fn get_repository(&self, name: &str) -> Option<&RepositoryDefinition>
Get a repository by name
Sourcepub fn list_repositories(&self) -> Vec<&RepositoryDefinition>
pub fn list_repositories(&self) -> Vec<&RepositoryDefinition>
List all repositories (sorted by priority)
Sourcepub async fn get_client(
&self,
name: &str,
) -> Result<Arc<dyn RepositoryClient + Send + Sync>, ServiceError>
pub async fn get_client( &self, name: &str, ) -> Result<Arc<dyn RepositoryClient + Send + Sync>, ServiceError>
Get or create a repository client
Sourcepub fn get_default_repository(&self) -> Option<&RepositoryDefinition>
pub fn get_default_repository(&self) -> Option<&RepositoryDefinition>
Get default repository (first by priority, or one named “default”)
Auto Trait Implementations§
impl Freeze for RepositoryManager
impl !RefUnwindSafe for RepositoryManager
impl Send for RepositoryManager
impl Sync for RepositoryManager
impl Unpin for RepositoryManager
impl UnsafeUnpin for RepositoryManager
impl !UnwindSafe for RepositoryManager
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 moreCreates a shared type from an unshared type.