pub struct ServiceFactoryBuilder { /* private fields */ }Expand description
ServiceFactory builder that aggregate parameters for future gRPC-channel and gRPC-metadata
Implementations§
Source§impl ServiceFactoryBuilder
impl ServiceFactoryBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create empty ServiceFactoryBuilder
Sourcepub fn base_url<S: Into<String>>(self, base_url: S) -> Self
pub fn base_url<S: Into<String>>(self, base_url: S) -> Self
Set a base URL if needed to change endpoint address
Sourcepub fn user_agent<S: Into<String>>(self, user_agent: S) -> Self
pub fn user_agent<S: Into<String>>(self, user_agent: S) -> Self
Set User-Agent http2 layer header
Sourcepub fn headers(self, headers: Vec<(&'static str, String)>) -> Self
pub fn headers(self, headers: Vec<(&'static str, String)>) -> Self
Set a headers that converted into gRPC metadata
Sourcepub fn rate_limit(self, rate_limit: (u64, Duration)) -> Self
pub fn rate_limit(self, rate_limit: (u64, Duration)) -> Self
Set tonic rate_limit for Endpoint
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Set tonic connect_timeout for Endpoint
Sourcepub fn tcp_keepalive(self, tcp_keepalive: Duration) -> Self
pub fn tcp_keepalive(self, tcp_keepalive: Duration) -> Self
Set tonic tcp_keepalive for Endpoint
Sourcepub fn build(self) -> Result<ServiceFactory, Box<dyn Error>>
pub fn build(self) -> Result<ServiceFactory, Box<dyn Error>>
Bulid the ServiceFactory
Auto Trait Implementations§
impl Freeze for ServiceFactoryBuilder
impl RefUnwindSafe for ServiceFactoryBuilder
impl Send for ServiceFactoryBuilder
impl Sync for ServiceFactoryBuilder
impl Unpin for ServiceFactoryBuilder
impl UnwindSafe for ServiceFactoryBuilder
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> 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