pub struct ClientBuilder { /* private fields */ }Expand description
A builder for Subscriber.
§Example
let builder = Subscriber::builder();
let client = builder
.with_endpoint("https://pubsub.googleapis.com")
.build()
.await?;Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub async fn build(self) -> BuilderResult<Subscriber>
pub async fn build(self) -> BuilderResult<Subscriber>
Sourcepub fn with_endpoint<V: Into<String>>(self, v: V) -> Self
pub fn with_endpoint<V: Into<String>>(self, v: V) -> Self
Sets the endpoint.
§Example
let client = Subscriber::builder()
.with_endpoint("https://private.googleapis.com")
.build()
.await?;Sourcepub fn with_credentials<V: Into<Credentials>>(self, v: V) -> Self
pub fn with_credentials<V: Into<Credentials>>(self, v: V) -> Self
Configures the authentication credentials.
More information about valid credentials types can be found in the google-cloud-auth crate documentation.
§Example
use auth::credentials::mds;
let client = Subscriber::builder()
.with_credentials(
mds::Builder::default()
.with_scopes(["https://www.googleapis.com/auth/cloud-platform.read-only"])
.build()?)
.build()
.await?;Sourcepub fn with_grpc_subchannel_count(self, v: usize) -> Self
pub fn with_grpc_subchannel_count(self, v: usize) -> Self
Configure the number of subchannels used by the client.
§Example
let count = std::thread::available_parallelism()?.get();
let client = Subscriber::builder()
.with_grpc_subchannel_count(std::cmp::max(1, count))
.build()
.await?;gRPC-based clients may exhibit high latency if many requests need to be demuxed over a single HTTP/2 connection (often called a subchannel in gRPC).
Consider using more subchannels if your application makes many concurrent requests. Consider using fewer subchannels if your application needs the file descriptors for other purposes.
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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
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> 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