pub struct LoreBackend { /* private fields */ }Expand description
A VcsBackend implementation backed by the Lore VCS CLI (lore(1)).
LoreBackend requires a remote lore:// URL and a workspace identity
so that it can call lore repository create / lore clone during init.
Use LoreBackend::new() for the default configuration
(reads env-var overrides for the server URL, or falls back to a
local-dev default).
Implementations§
Source§impl LoreBackend
impl LoreBackend
Sourcepub fn new(remote_url: &str, workspace_id: &str) -> Self
pub fn new(remote_url: &str, workspace_id: &str) -> Self
Create a new Lore backend.
remote_url should be a lore://host/repository URL.
workspace_id scopes the repository to a multi-tenant workspace.
Sourcepub fn with_grpc(self, client: LoreGrpcClient) -> Self
pub fn with_grpc(self, client: LoreGrpcClient) -> Self
Trait Implementations§
Source§impl Clone for LoreBackend
impl Clone for LoreBackend
Source§fn clone(&self) -> LoreBackend
fn clone(&self) -> LoreBackend
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoreBackend
impl Debug for LoreBackend
Source§impl VcsBackend for LoreBackend
impl VcsBackend for LoreBackend
Source§fn init(&self, path: &Path) -> Result<(), NapError>
fn init(&self, path: &Path) -> Result<(), NapError>
Initialize a new repository at the given path.
Source§fn commit(
&self,
path: &Path,
message: &str,
author: &str,
) -> Result<String, NapError>
fn commit( &self, path: &Path, message: &str, author: &str, ) -> Result<String, NapError>
Stage all files and create a commit.
Source§fn read_file_at_ref(
&self,
repo_path: &Path,
file_path: &str,
reference: Option<&str>,
) -> Result<String, NapError>
fn read_file_at_ref( &self, repo_path: &Path, file_path: &str, reference: Option<&str>, ) -> Result<String, NapError>
Read a file’s content at a specific ref (branch, tag, or commit hash).
If
reference is None, reads from the current working tree.Source§fn log(
&self,
path: &Path,
file: Option<&str>,
limit: usize,
) -> Result<Vec<CommitInfo>, NapError>
fn log( &self, path: &Path, file: Option<&str>, limit: usize, ) -> Result<Vec<CommitInfo>, NapError>
Get the commit log for the repository, optionally filtered to a specific file.
Source§fn current_branch(&self, path: &Path) -> Result<String, NapError>
fn current_branch(&self, path: &Path) -> Result<String, NapError>
Get the current branch name.
Source§fn create_tag(&self, path: &Path, name: &str) -> Result<(), NapError>
fn create_tag(&self, path: &Path, name: &str) -> Result<(), NapError>
Create a tag at the current HEAD.
List all tags.
Source§fn revert(&self, path: &Path, commit_hash: &str) -> Result<String, NapError>
fn revert(&self, path: &Path, commit_hash: &str) -> Result<String, NapError>
Revert a commit by creating a new commit that undoes it.
Source§fn resolve_branch_head(
&self,
path: &Path,
branch: &str,
) -> Result<String, NapError>
fn resolve_branch_head( &self, path: &Path, branch: &str, ) -> Result<String, NapError>
Resolve the most recent commit hash on a given branch. Read more
Source§fn add_remote(&self, path: &Path, name: &str, url: &str) -> Result<(), NapError>
fn add_remote(&self, path: &Path, name: &str, url: &str) -> Result<(), NapError>
Add a remote.
Source§fn list_remotes(&self, path: &Path) -> Result<Vec<(String, String)>, NapError>
fn list_remotes(&self, path: &Path) -> Result<Vec<(String, String)>, NapError>
List remotes as
(name, url) pairs.Auto Trait Implementations§
impl !RefUnwindSafe for LoreBackend
impl !UnwindSafe for LoreBackend
impl Freeze for LoreBackend
impl Send for LoreBackend
impl Sync for LoreBackend
impl Unpin for LoreBackend
impl UnsafeUnpin for LoreBackend
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request