[][src]Struct tonic::transport::Endpoint

pub struct Endpoint { /* fields omitted */ }
This is supported on feature="transport" only.

Channel builder.

This struct is used to build and configure HTTP/2 channels.

Methods

impl Endpoint[src]

pub fn from_static(s: &'static str) -> Self[src]

This is supported on feature="transport" only.

Convert an Endpoint from a static string.

Endpoint::from_static("https://example.com");

pub fn from_shared(s: impl Into<Bytes>) -> Result<Self, InvalidUriBytes>[src]

This is supported on feature="transport" only.

Convert an Endpoint from shared bytes.

Endpoint::from_shared("https://example.com".to_string());

Important traits for &'_ mut F
pub fn timeout(&mut self, dur: Duration) -> &mut Self[src]

This is supported on feature="transport" only.

Apply a timeout to each request.

builder.timeout(Duration::from_secs(5));

Important traits for &'_ mut F
pub fn concurrency_limit(&mut self, limit: usize) -> &mut Self[src]

This is supported on feature="transport" only.

Apply a concurrency limit to each request.

builder.concurrency_limit(256);

Important traits for &'_ mut F
pub fn rate_limit(&mut self, limit: u64, duration: Duration) -> &mut Self[src]

This is supported on feature="transport" only.

Apply a rate limit to each request.

builder.rate_limit(32, Duration::from_secs(1));

Important traits for &'_ mut F
pub fn initial_stream_window_size(
    &mut self,
    sz: impl Into<Option<u32>>
) -> &mut Self
[src]

This is supported on feature="transport" only.

Sets the SETTINGS_INITIAL_WINDOW_SIZE option for HTTP2 stream-level flow control.

Default is 65,535

Important traits for &'_ mut F
pub fn initial_connection_window_size(
    &mut self,
    sz: impl Into<Option<u32>>
) -> &mut Self
[src]

This is supported on feature="transport" only.

Sets the max connection-level flow control for HTTP2

Default is 65,535

Important traits for &'_ mut F
pub fn intercept_headers<F>(&mut self, f: F) -> &mut Self where
    F: Fn(&mut HeaderMap) + Send + Sync + 'static, 
[src]

This is supported on feature="transport" only.

Intercept outbound HTTP Request headers;

Important traits for &'_ mut F
pub fn tls_config(&mut self, tls_config: &ClientTlsConfig) -> &mut Self[src]

This is supported on feature="transport" only.

Configures TLS for the endpoint.

pub fn channel(&self) -> Channel[src]

This is supported on feature="transport" only.

Create a channel from this config.

Trait Implementations

impl From<Uri> for Endpoint[src]

impl Clone for Endpoint[src]

impl Debug for Endpoint[src]

impl TryFrom<Bytes> for Endpoint[src]

type Error = InvalidUriBytes

The type returned in the event of a conversion error.

impl TryFrom<String> for Endpoint[src]

type Error = InvalidUriBytes

The type returned in the event of a conversion error.

impl TryFrom<&'static str> for Endpoint[src]

type Error = Never

The type returned in the event of a conversion error.

Auto Trait Implementations

impl Send for Endpoint

impl Sync for Endpoint

impl Unpin for Endpoint

impl !UnwindSafe for Endpoint

impl !RefUnwindSafe for Endpoint

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]