#[non_exhaustive]pub struct StaticChannelPoolConfig { /* private fields */ }Expand description
Configuration for a static (fixed-size) channel pool.
§Example
let config = StaticChannelPoolConfig::new(8);
let client = Spanner::builder()
.with_channel_pool(config)
.build()
.await?;Implementations§
Source§impl StaticChannelPoolConfig
impl StaticChannelPoolConfig
Sourcepub fn new(num_channels: usize) -> Self
pub fn new(num_channels: usize) -> Self
Creates a new static channel pool configuration with the specified number of channels.
§Example
let client = Spanner::builder()
.with_channel_pool(StaticChannelPoolConfig::new(4))
.build()
.await?;Sourcepub fn with_num_channels(self, num_channels: usize) -> Self
pub fn with_num_channels(self, num_channels: usize) -> Self
Sets the number of channels configured for the static pool.
§Example
use google_cloud_spanner::channel_pool::StaticChannelPoolConfig;
let config = StaticChannelPoolConfig::default().with_num_channels(8);
assert_eq!(config.num_channels(), 8);Sourcepub fn num_channels(&self) -> usize
pub fn num_channels(&self) -> usize
Returns the number of channels configured for the static pool.
Trait Implementations§
Source§impl Clone for StaticChannelPoolConfig
impl Clone for StaticChannelPoolConfig
Source§impl Debug for StaticChannelPoolConfig
impl Debug for StaticChannelPoolConfig
Source§impl Default for StaticChannelPoolConfig
impl Default for StaticChannelPoolConfig
impl Eq for StaticChannelPoolConfig
Source§impl From<StaticChannelPoolConfig> for ChannelPoolConfig
impl From<StaticChannelPoolConfig> for ChannelPoolConfig
Source§fn from(config: StaticChannelPoolConfig) -> Self
fn from(config: StaticChannelPoolConfig) -> Self
Converts to this type from the input type.
Source§impl PartialEq for StaticChannelPoolConfig
impl PartialEq for StaticChannelPoolConfig
impl StructuralPartialEq for StaticChannelPoolConfig
Auto Trait Implementations§
impl Forget for StaticChannelPoolConfig
impl Freeze for StaticChannelPoolConfig
impl Move for StaticChannelPoolConfig
impl RefUnwindSafe for StaticChannelPoolConfig
impl Send for StaticChannelPoolConfig
impl Sync for StaticChannelPoolConfig
impl Unpin for StaticChannelPoolConfig
impl UnsafeUnpin for StaticChannelPoolConfig
impl UnwindSafe for StaticChannelPoolConfig
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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