[−][src]Struct tonic::transport::Endpoint
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]
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]
feature="transport"
only.Convert an Endpoint
from shared bytes.
Endpoint::from_shared("https://example.com".to_string());
ⓘImportant traits for &'_ mut Fpub fn timeout(&mut self, dur: Duration) -> &mut Self
[src]
feature="transport"
only.Apply a timeout to each request.
builder.timeout(Duration::from_secs(5));
ⓘImportant traits for &'_ mut Fpub fn concurrency_limit(&mut self, limit: usize) -> &mut Self
[src]
feature="transport"
only.Apply a concurrency limit to each request.
builder.concurrency_limit(256);
ⓘImportant traits for &'_ mut Fpub fn rate_limit(&mut self, limit: u64, duration: Duration) -> &mut Self
[src]
feature="transport"
only.Apply a rate limit to each request.
builder.rate_limit(32, Duration::from_secs(1));
ⓘImportant traits for &'_ mut Fpub fn openssl_tls(
&mut self,
ca: Certificate,
domain: impl Into<Option<String>>
) -> &mut Self
[src]
&mut self,
ca: Certificate,
domain: impl Into<Option<String>>
) -> &mut Self
feature="transport"
and feature="openssl"
only.Enable TLS and apply the CA as the root certificate.
Providing an optional domain to override. If None
is passed to this
the TLS implementation will use the Uri
that was used to create the
Endpoint
builder.
let ca = std::fs::read_to_string("ca.pem")?; let ca = Certificate::from_pem(ca); builder.openssl_tls(ca, "example.com".to_string());
ⓘImportant traits for &'_ mut Fpub fn rustls_tls(
&mut self,
ca: Certificate,
domain: impl Into<Option<String>>
) -> &mut Self
[src]
&mut self,
ca: Certificate,
domain: impl Into<Option<String>>
) -> &mut Self
feature="transport"
and feature="rustls"
only.Enable TLS and apply the CA as the root certificate.
Providing an optional domain to override. If None
is passed to this
the TLS implementation will use the Uri
that was used to create the
Endpoint
builder.
let ca = std::fs::read_to_string("ca.pem")?; let ca = Certificate::from_pem(ca); builder.rustls_tls(ca, "example.com".to_string());
ⓘImportant traits for &'_ mut Fpub fn intercept_headers<F>(&mut self, f: F) -> &mut Self where
F: Fn(&mut HeaderMap) + Send + Sync + 'static,
[src]
F: Fn(&mut HeaderMap) + Send + Sync + 'static,
feature="transport"
only.Intercept outbound HTTP Request headers;
pub fn channel(&self) -> Channel
[src]
feature="transport"
only.Create a channel from this config.
Trait Implementations
impl Clone for Endpoint
[src]
impl From<Uri> 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.
fn try_from(t: Bytes) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for Endpoint
[src]
type Error = InvalidUriBytes
The type returned in the event of a conversion error.
fn try_from(t: String) -> Result<Self, Self::Error>
[src]
impl TryFrom<&'static str> for Endpoint
[src]
Auto Trait Implementations
impl Send for Endpoint
impl Unpin for Endpoint
impl Sync for Endpoint
impl !UnwindSafe for Endpoint
impl !RefUnwindSafe for Endpoint
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
ⓘImportant traits for &'_ mut Ffn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,