Struct grpcio::ChannelBuilder [−][src]
Channel
factory in order to configure the properties.
Implementations
impl ChannelBuilder
[src]
pub fn secure_connect(self, addr: &str, creds: ChannelCredentials) -> Channel
[src]
Build a secure Channel
that connects to a specific address.
impl ChannelBuilder
[src]
pub fn new(env: Arc<Environment>) -> ChannelBuilder
[src]
Initialize a new ChannelBuilder
.
pub fn default_authority<S: Into<Vec<u8>>>(self, authority: S) -> ChannelBuilder
[src]
Set default authority to pass if none specified on call construction.
pub fn set_resource_quota(self, quota: ResourceQuota) -> ChannelBuilder
[src]
Set resource quota by consuming a ResourceQuota
pub fn max_concurrent_stream(self, num: i32) -> ChannelBuilder
[src]
Set maximum number of concurrent incoming streams to allow on a HTTP/2 connection.
pub fn max_receive_message_len(self, len: i32) -> ChannelBuilder
[src]
Set maximum message length that the channel can receive. -1
means unlimited.
pub fn max_send_message_len(self, len: i32) -> ChannelBuilder
[src]
Set maximum message length that the channel can send. -1
means unlimited.
pub fn max_reconnect_backoff(self, backoff: Duration) -> ChannelBuilder
[src]
Set maximum time between subsequent connection attempts.
pub fn initial_reconnect_backoff(self, backoff: Duration) -> ChannelBuilder
[src]
Set time between the first and second connection attempts.
pub fn https_initial_seq_number(self, number: i32) -> ChannelBuilder
[src]
Set initial sequence number for HTTP/2 transports.
pub fn stream_initial_window_size(self, window_size: i32) -> ChannelBuilder
[src]
Set amount to read ahead on individual streams. Defaults to 64KB. Larger values help throughput on high-latency connections.
pub fn primary_user_agent(self, agent: &str) -> ChannelBuilder
[src]
Set primary user agent, which goes at the start of the user-agent metadata sent on each request.
pub fn reuse_port(self, reuse: bool) -> ChannelBuilder
[src]
Set whether to allow the use of SO_REUSEPORT
if available. Defaults to true
.
pub fn tcp_read_chunk_size(self, bytes: i32) -> ChannelBuilder
[src]
Set the size of slice to try and read from the wire each time.
pub fn tcp_min_read_chunk_size(self, bytes: i32) -> ChannelBuilder
[src]
Set the minimum size of slice to try and read from the wire each time.
pub fn tcp_max_read_chunk_size(self, bytes: i32) -> ChannelBuilder
[src]
Set the maximum size of slice to try and read from the wire each time.
pub fn http2_write_buffer_size(self, size: i32) -> ChannelBuilder
[src]
How much data are we willing to queue up per stream if write_buffer_hint is set. This is an upper bound.
pub fn http2_max_frame_size(self, size: i32) -> ChannelBuilder
[src]
How big a frame are we willing to receive via HTTP/2. Min 16384, max 16777215. Larger values give lower CPU usage for large messages, but more head of line blocking for small messages.
pub fn http2_bdp_probe(self, enable: bool) -> ChannelBuilder
[src]
Set whether to enable BDP probing.
pub fn http2_min_sent_ping_interval_without_data(
self,
interval: Duration
) -> ChannelBuilder
[src]
self,
interval: Duration
) -> ChannelBuilder
Minimum time between sending successive ping frames without receiving any data frame.
pub fn http2_min_recv_ping_interval_without_data(
self,
interval: Duration
) -> ChannelBuilder
[src]
self,
interval: Duration
) -> ChannelBuilder
Minimum allowed time between receiving successive ping frames without sending any data frame.
pub fn http2_max_pings_without_data(self, num: i32) -> ChannelBuilder
[src]
How many pings can we send before needing to send a data frame or header frame? (0 indicates that an infinite number of pings can be sent without sending a data frame or header frame)
pub fn http2_max_ping_strikes(self, num: i32) -> ChannelBuilder
[src]
How many misbehaving pings the server can bear before sending goaway and closing the transport? (0 indicates that the server can bear an infinite number of misbehaving pings)
pub fn default_compression_algorithm(
self,
algo: CompressionAlgorithms
) -> ChannelBuilder
[src]
self,
algo: CompressionAlgorithms
) -> ChannelBuilder
Set default compression algorithm for the channel.
pub fn default_compression_level(
self,
level: CompressionLevel
) -> ChannelBuilder
[src]
self,
level: CompressionLevel
) -> ChannelBuilder
Set default compression level for the channel.
pub fn keepalive_time(self, timeout: Duration) -> ChannelBuilder
[src]
After a duration of this time the client/server pings its peer to see if the transport is still alive.
pub fn keepalive_timeout(self, timeout: Duration) -> ChannelBuilder
[src]
After waiting for a duration of this time, if the keepalive ping sender does not receive the ping ack, it will close the transport.
pub fn keepalive_permit_without_calls(self, allow: bool) -> ChannelBuilder
[src]
Is it permissible to send keepalive pings without any outstanding streams.
pub fn optimize_for(self, target: OptTarget) -> ChannelBuilder
[src]
Set optimization target for the channel. See OptTarget
for all available
optimization targets. Defaults to OptTarget::Blend
.
pub fn load_balancing_policy(self, lb_policy: LbPolicy) -> ChannelBuilder
[src]
Set LbPolicy for channel
This method allows one to set the load-balancing policy for a given channel.
pub fn build_args(&self) -> ChannelArgs
[src]
Build ChannelArgs
from the current configuration.
pub fn connect(self, addr: &str) -> Channel
[src]
Build an insecure Channel
that connects to a specific address.
pub unsafe fn connect_from_fd(self, target: &str, fd: c_int) -> Channel
[src]
Build an insecure Channel
taking over an established connection from
a file descriptor. The target string given is purely informative to
describe the endpoint of the connection. Takes ownership of the given
file descriptor and will close it when the connection is closed.
This function is available on posix systems only.
Safety
The file descriptor must correspond to a connected stream socket. After this call, the socket must not be accessed (read / written / closed) by other code.
Auto Trait Implementations
impl !RefUnwindSafe for ChannelBuilder
impl !Send for ChannelBuilder
impl !Sync for ChannelBuilder
impl Unpin for ChannelBuilder
impl !UnwindSafe for ChannelBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,