pub struct EndpointTemplate { /* private fields */ }Expand description
Implementations§
Source§impl EndpointTemplate
impl EndpointTemplate
Sourcepub fn new(url: impl TryInto<Url>) -> Result<Self, EndpointTemplateError>
pub fn new(url: impl TryInto<Url>) -> Result<Self, EndpointTemplateError>
Creates a new EndpointTemplate from the provided URL.
§Errors
- Will return
EndpointTemplateError::NotAUrlif the provided URL is not a valid URL. - Will return
EndpointTemplateError::HostMissingif the provided URL does not contain a host. - Will return
EndpointTemplateError::AlreadyIpAddressif the provided URL already contains an IP address. - Will return
EndpointTemplateError::Inconvertibleif the provided URL cannot be converted to the tonic’s internal representation.
Sourcepub fn user_agent(
self,
user_agent: impl TryInto<HeaderValue>,
) -> Result<Self, EndpointTemplateError>
pub fn user_agent( self, user_agent: impl TryInto<HeaderValue>, ) -> Result<Self, EndpointTemplateError>
r.f. Endpoint::user_agent.
§Errors
Will return EndpointTemplateError::InvalidUserAgent if the provided
value cannot be converted to a HeaderValue and would cause a failure
when building an endpoint.
Sourcepub fn origin(self, origin: Uri) -> Self
pub fn origin(self, origin: Uri) -> Self
r.f. Endpoint::origin.
Sourcepub fn timeout(self, dur: Duration) -> Self
pub fn timeout(self, dur: Duration) -> Self
r.f. Endpoint::timeout.
Sourcepub fn connect_timeout(self, dur: Duration) -> Self
pub fn connect_timeout(self, dur: Duration) -> Self
Sourcepub fn tcp_keepalive(self, tcp_keepalive: Option<Duration>) -> Self
pub fn tcp_keepalive(self, tcp_keepalive: Option<Duration>) -> Self
r.f. Endpoint::tcp_keepalive.
Sourcepub fn tcp_keepalive_interval(self, interval: Duration) -> Self
pub fn tcp_keepalive_interval(self, interval: Duration) -> Self
Sourcepub fn tcp_keepalive_retries(self, retries: u32) -> Self
pub fn tcp_keepalive_retries(self, retries: u32) -> Self
Sourcepub fn concurrency_limit(self, limit: usize) -> Self
pub fn concurrency_limit(self, limit: usize) -> Self
Sourcepub fn rate_limit(self, limit: u64, duration: Duration) -> Self
pub fn rate_limit(self, limit: u64, duration: Duration) -> Self
r.f. Endpoint::rate_limit.
Sourcepub fn initial_stream_window_size(self, sz: impl Into<Option<u32>>) -> Self
pub fn initial_stream_window_size(self, sz: impl Into<Option<u32>>) -> Self
Sourcepub fn initial_connection_window_size(self, sz: impl Into<Option<u32>>) -> Self
pub fn initial_connection_window_size(self, sz: impl Into<Option<u32>>) -> Self
Sourcepub fn buffer_size(self, sz: impl Into<Option<usize>>) -> Self
pub fn buffer_size(self, sz: impl Into<Option<usize>>) -> Self
r.f. Endpoint::buffer_size.
Sourcepub fn tls_config(
self,
tls_config: ClientTlsConfig,
) -> Result<Self, EndpointTemplateError>
Available on crate feature tls only.
pub fn tls_config( self, tls_config: ClientTlsConfig, ) -> Result<Self, EndpointTemplateError>
tls only.r.f. Endpoint::tls_config.
§Errors
Will return EndpointTemplateError::InvalidTlsConfig if the provided
config cannot be passed to an Endpoint and would cause a failure
when building an endpoint.
Sourcepub fn tcp_nodelay(self, enabled: bool) -> Self
pub fn tcp_nodelay(self, enabled: bool) -> Self
r.f. Endpoint::tcp_nodelay.
Sourcepub fn http2_keep_alive_interval(self, interval: Duration) -> Self
pub fn http2_keep_alive_interval(self, interval: Duration) -> Self
Sourcepub fn keep_alive_timeout(self, duration: Duration) -> Self
pub fn keep_alive_timeout(self, duration: Duration) -> Self
Sourcepub fn keep_alive_while_idle(self, enabled: bool) -> Self
pub fn keep_alive_while_idle(self, enabled: bool) -> Self
Sourcepub fn http2_adaptive_window(self, enabled: bool) -> Self
pub fn http2_adaptive_window(self, enabled: bool) -> Self
Sourcepub fn http2_max_header_list_size(self, size: u32) -> Self
pub fn http2_max_header_list_size(self, size: u32) -> Self
Sourcepub fn local_address(self, ip: Option<IpAddr>) -> Self
pub fn local_address(self, ip: Option<IpAddr>) -> Self
r.f. Endpoint::local_address.
Trait Implementations§
Source§impl Clone for EndpointTemplate
impl Clone for EndpointTemplate
Source§fn clone(&self) -> EndpointTemplate
fn clone(&self) -> EndpointTemplate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EndpointTemplate
impl Debug for EndpointTemplate
Auto Trait Implementations§
impl !Freeze for EndpointTemplate
impl RefUnwindSafe for EndpointTemplate
impl Send for EndpointTemplate
impl Sync for EndpointTemplate
impl Unpin for EndpointTemplate
impl UnwindSafe for EndpointTemplate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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