pub struct GitProviderStore { /* private fields */ }Expand description
Stores the registered GitProvider implementation.
Registered by the git module during init(). Consumers retrieve
the store from ServiceRegistry and call get()
to access the provider.
§Example
ⓘ
// In module init():
let store = ctx.services.get_or_create::<GitProviderStore>();
store.register(Arc::new(MyGitProvider));
// In consumers:
let store = ctx.services.get::<GitProviderStore>()?;
let git = store.get()?;
let branch = git.current_branch(&cwd);Implementations§
Source§impl GitProviderStore
impl GitProviderStore
Sourcepub fn register(&self, provider: Arc<dyn GitProvider>)
pub fn register(&self, provider: Arc<dyn GitProvider>)
Register a provider implementation.
Replaces any previously registered provider.
§Panics
Panics if the internal lock is poisoned.
Trait Implementations§
Source§impl Debug for GitProviderStore
impl Debug for GitProviderStore
Source§impl Default for GitProviderStore
impl Default for GitProviderStore
impl Service for GitProviderStore
Auto Trait Implementations§
impl !Freeze for GitProviderStore
impl RefUnwindSafe for GitProviderStore
impl Send for GitProviderStore
impl Sync for GitProviderStore
impl Unpin for GitProviderStore
impl UnsafeUnpin for GitProviderStore
impl UnwindSafe for GitProviderStore
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