pub struct LoreGrpcClient { /* private fields */ }Expand description
A gRPC client for lore-server’s RevisionService.
This client handles only lightweight metadata operations:
| Operation | RPC | Purpose |
|---|---|---|
get_branch_by_name | BranchGet | Fetch remote branch tip before pull |
push_branch | BranchPush | Advance remote branch tip after push |
Blob transfer (the heavy payload) remains on the lore CLI / HTTP.
Implementations§
Source§impl LoreGrpcClient
impl LoreGrpcClient
Sourcepub async fn get_branch_by_name(&self, name: &str) -> Result<Branch, NapError>
pub async fn get_branch_by_name(&self, name: &str) -> Result<Branch, NapError>
Look up a branch by its human-readable name.
Returns the Branch record containing id (binary UUID),
name, latest (tip signature), and other metadata.
Sourcepub async fn push_branch(
&self,
branch_id: Bytes,
revision_signature: Bytes,
force: bool,
) -> Result<(), NapError>
pub async fn push_branch( &self, branch_id: Bytes, revision_signature: Bytes, force: bool, ) -> Result<(), NapError>
Push a revision as the new tip of a branch.
branch_id— binary branch UUID (obtained from [get_branch_by_name]).revision_signature— raw content hash of the revision to set as the new tip.force— iftrue, bypasses fast-forward checks on the server. Whenfalse, the server requires the new tip to descend from the current tip (or performs a fast-forward merge).
Sourcepub fn builder_from_env() -> Result<Option<Self>, NapError>
pub fn builder_from_env() -> Result<Option<Self>, NapError>
Convenience constructor that reads all configuration from environment
variables. Returns Ok(None) when NAP_LORE_GRPC_ENDPOINT is not
set, allowing callers to gracefully skip gRPC integration.
See Builder::from_env for the list of recognised variables.
Trait Implementations§
Source§impl Clone for LoreGrpcClient
impl Clone for LoreGrpcClient
Source§fn clone(&self) -> LoreGrpcClient
fn clone(&self) -> LoreGrpcClient
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for LoreGrpcClient
impl !UnwindSafe for LoreGrpcClient
impl Freeze for LoreGrpcClient
impl Send for LoreGrpcClient
impl Sync for LoreGrpcClient
impl Unpin for LoreGrpcClient
impl UnsafeUnpin for LoreGrpcClient
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