pub struct Builder { /* private fields */ }Expand description
Configuration builder for LoreGrpcClient.
§Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
NAP_LORE_GRPC_ENDPOINT | Yes | — | gRPC endpoint URL |
NAP_LORE_GRPC_TOKEN | No | — | JWT bearer token |
NAP_LORE_GRPC_RID | No | — | Repository ID (hex-encoded binary) |
NAP_LORE_GRPC_INSECURE | No | 0 | Skip TLS verification when 1 |
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn endpoint(self, endpoint: impl Into<String>) -> Self
pub fn endpoint(self, endpoint: impl Into<String>) -> Self
Set the gRPC endpoint URL.
Format: https://host:port (TLS) or http://host:port (plain).
Sourcepub fn token(self, token: impl Into<String>) -> Self
pub fn token(self, token: impl Into<String>) -> Self
Set a JWT bearer token for authenticated requests.
Sourcepub fn repository_id(self, id: impl Into<Vec<u8>>) -> Self
pub fn repository_id(self, id: impl Into<Vec<u8>>) -> Self
Set the repository ID to inject as binary metadata.
This should match the repository / partition UUID the lore-server expects. Pass the raw bytes (not hex-encoded).
Sourcepub fn insecure(self, insecure: bool) -> Self
pub fn insecure(self, insecure: bool) -> Self
When true, skip TLS certificate validation.
Use this in development environments where the lore-server uses self-signed certificates.
Sourcepub fn build(self) -> Result<LoreGrpcClient, NapError>
pub fn build(self) -> Result<LoreGrpcClient, NapError>
Build the LoreGrpcClient.
Connection is deferred via Endpoint::connect_lazy; the
first RPC will establish the TCP + TLS handshake.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
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> 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