pub struct GitRefStore<'r> { /* private fields */ }Expand description
Git-backed implementation of RefReader and RefWriter.
References are Git refs. resolve_ref returns the commit OID bytes
the ref points to. update_ref creates or updates a ref to point
at a commit whose tree contains the given data.
Usage:
ⓘ
use auths_infra_git::{GitRepo, GitRefStore};
use auths_core::ports::storage::RefReader;
let repo = GitRepo::open("/path/to/repo")?;
let store = GitRefStore::new(&repo);
let oid_bytes = store.resolve_ref("refs/auths/registry")?;Implementations§
Trait Implementations§
Source§impl RefReader for GitRefStore<'_>
impl RefReader for GitRefStore<'_>
Source§impl RefWriter for GitRefStore<'_>
impl RefWriter for GitRefStore<'_>
Source§fn update_ref(
&self,
refname: &str,
target: &[u8],
message: &str,
) -> Result<(), StorageError>
fn update_ref( &self, refname: &str, target: &[u8], message: &str, ) -> Result<(), StorageError>
Sets a reference to point at the given target bytes. Read more
Source§fn delete_ref(&self, refname: &str) -> Result<(), StorageError>
fn delete_ref(&self, refname: &str) -> Result<(), StorageError>
Deletes the named reference. Read more
Auto Trait Implementations§
impl<'r> Freeze for GitRefStore<'r>
impl<'r> RefUnwindSafe for GitRefStore<'r>
impl<'r> Send for GitRefStore<'r>
impl<'r> Sync for GitRefStore<'r>
impl<'r> Unpin for GitRefStore<'r>
impl<'r> UnsafeUnpin for GitRefStore<'r>
impl<'r> UnwindSafe for GitRefStore<'r>
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