pub struct AqlClient { /* private fields */ }Expand description
AQL client with connection pooling, retry logic, and compression
Implementations§
Source§impl AqlClient
impl AqlClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new client with default configuration
Default configuration uses plaintext (no TLS), so this never fails.
Sourcepub fn with_config(config: ClientConfig) -> NetResult<Self>
pub fn with_config(config: ClientConfig) -> NetResult<Self>
Create a new client with custom configuration
§Errors
Returns NetError::TlsError if TLS configuration is invalid or
certificate/key files cannot be read.
Sourcepub fn builder() -> AqlClientBuilder
pub fn builder() -> AqlClientBuilder
Create a client using a builder pattern
Sourcepub fn add_endpoint(&self, id: String, address: String)
pub fn add_endpoint(&self, id: String, address: String)
Add an endpoint to the client’s connection pool
Sourcepub fn add_endpoint_with_weight(&self, id: String, address: String, weight: u32)
pub fn add_endpoint_with_weight(&self, id: String, address: String, weight: u32)
Add an endpoint with weight for weighted load balancing
Sourcepub fn remove_endpoint(&self, endpoint_id: &str) -> bool
pub fn remove_endpoint(&self, endpoint_id: &str) -> bool
Remove an endpoint from the connection pool
Sourcepub async fn get_service_client(&self) -> NetResult<AqlServiceClient<Channel>>
pub async fn get_service_client(&self) -> NetResult<AqlServiceClient<Channel>>
Get a gRPC AQL service client from the connection pool
Applies compression settings if the compression feature is enabled and
the compression config is set to a non-identity algorithm.
Sourcepub async fn execute_query(
&self,
request: QueryRequest,
) -> NetResult<QueryResponse>
pub async fn execute_query( &self, request: QueryRequest, ) -> NetResult<QueryResponse>
Execute a single AQL query with retry and circuit breaker protection
Sourcepub async fn execute_batch(
&self,
request: BatchRequest,
) -> NetResult<BatchResponse>
pub async fn execute_batch( &self, request: BatchRequest, ) -> NetResult<BatchResponse>
Execute a batch of AQL queries with retry and circuit breaker protection
Sourcepub async fn health_check(
&self,
service: Option<String>,
) -> NetResult<HealthCheckResponse>
pub async fn health_check( &self, service: Option<String>, ) -> NetResult<HealthCheckResponse>
Perform a health check against the server
Sourcepub async fn execute_with_retry<F, T>(&self, operation: F) -> NetResult<T>
pub async fn execute_with_retry<F, T>(&self, operation: F) -> NetResult<T>
Execute an operation with retry logic, circuit breaker, and exponential backoff
The operation closure receives an AqlServiceClient<Channel> and returns
a boxed future resolving to NetResult<T>.
Sourcepub fn pool_stats(&self) -> PoolStats
pub fn pool_stats(&self) -> PoolStats
Get connection pool statistics
Sourcepub fn circuit_breaker_stats(&self) -> Option<CircuitBreakerStats>
pub fn circuit_breaker_stats(&self) -> Option<CircuitBreakerStats>
Get circuit breaker statistics
Sourcepub fn retry_config(&self) -> &RetryConfig
pub fn retry_config(&self) -> &RetryConfig
Get the client’s retry configuration
Sourcepub fn compression_config(&self) -> &CompressionConfig
pub fn compression_config(&self) -> &CompressionConfig
Get the client’s compression configuration
Sourcepub fn tls_config(&self) -> Option<&TlsClientConfig>
pub fn tls_config(&self) -> Option<&TlsClientConfig>
Get the client’s TLS configuration
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AqlClient
impl !UnwindSafe for AqlClient
impl Freeze for AqlClient
impl Send for AqlClient
impl Sync for AqlClient
impl Unpin for AqlClient
impl UnsafeUnpin for AqlClient
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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>
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>
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>
T in a tonic::RequestSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.