Struct ginepro::LoadBalancedChannelBuilder
source · [−]pub struct LoadBalancedChannelBuilder<T, S> { /* private fields */ }
Expand description
Builder to configure and create a LoadBalancedChannel
.
Implementations
sourceimpl<S> LoadBalancedChannelBuilder<DnsResolver, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
impl<S> LoadBalancedChannelBuilder<DnsResolver, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
sourcepub fn new_with_service(
service_definition: S
) -> LoadBalancedChannelBuilder<DnsResolver, S>
pub fn new_with_service(
service_definition: S
) -> LoadBalancedChannelBuilder<DnsResolver, S>
Set the ServiceDefinition
of the gRPC server service
- e.g.
my.service.uri
and5000
.
All the service endpoints of a ServiceDefinition
will be
constructed by resolving all ips from ServiceDefinition::hostname
, and
using the portnumber ServiceDefinition::port
.
sourcepub fn lookup_service<T: LookupService + Send + Sync + 'static>(
self,
lookup_service: T
) -> LoadBalancedChannelBuilder<T, S>
pub fn lookup_service<T: LookupService + Send + Sync + 'static>(
self,
lookup_service: T
) -> LoadBalancedChannelBuilder<T, S>
Set a custom LookupService
.
sourceimpl<T: LookupService + Send + Sync + 'static + Sized, S> LoadBalancedChannelBuilder<T, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
impl<T: LookupService + Send + Sync + 'static + Sized, S> LoadBalancedChannelBuilder<T, S> where
S: TryInto<ServiceDefinition> + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>> + Send + Sync,
sourcepub fn dns_probe_interval(
self,
interval: Duration
) -> LoadBalancedChannelBuilder<T, S>
pub fn dns_probe_interval(
self,
interval: Duration
) -> LoadBalancedChannelBuilder<T, S>
Set the how often, the client should probe for changes to gRPC server endpoints. Default interval in seconds is 10.
sourcepub fn timeout(self, timeout: Duration) -> LoadBalancedChannelBuilder<T, S>
pub fn timeout(self, timeout: Duration) -> LoadBalancedChannelBuilder<T, S>
Set a timeout that will be applied to every new Endpoint
.
sourcepub fn resolution_strategy(
self,
resolution_strategy: ResolutionStrategy
) -> LoadBalancedChannelBuilder<T, S>
pub fn resolution_strategy(
self,
resolution_strategy: ResolutionStrategy
) -> LoadBalancedChannelBuilder<T, S>
Set the ResolutionStrategy
.
Default set to ResolutionStrategy::Lazy
.
If ResolutionStrategy::Lazy
the domain name will be resolved after-the-fact.
Instead, if ResolutionStrategy::Eager
is set the domain name will be attempted resolved
once before the LoadBalancedChannel
is created, which ensures that the channel
will have a non-empty of IPs on startup. If it fails the channel creation will also fail.
sourcepub fn with_tls(
self,
tls_config: ClientTlsConfig
) -> LoadBalancedChannelBuilder<T, S>
pub fn with_tls(
self,
tls_config: ClientTlsConfig
) -> LoadBalancedChannelBuilder<T, S>
Configure the channel to use tls.
A tls_config
MUST be specified to use the HTTPS
scheme.
sourcepub async fn channel(self) -> Result<LoadBalancedChannel, Error>
pub async fn channel(self) -> Result<LoadBalancedChannel, Error>
Construct a LoadBalancedChannel
from the LoadBalancedChannelBuilder
instance.
Auto Trait Implementations
impl<T, S> !RefUnwindSafe for LoadBalancedChannelBuilder<T, S>
impl<T, S> !Send for LoadBalancedChannelBuilder<T, S>
impl<T, S> !Sync for LoadBalancedChannelBuilder<T, S>
impl<T, S> Unpin for LoadBalancedChannelBuilder<T, S> where
S: Unpin,
impl<T, S> !UnwindSafe for LoadBalancedChannelBuilder<T, S>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more