pub struct ServerBuilder { /* private fields */ }
Expand description
A builder for a gRPC cache server.
Implementations§
Source§impl ServerBuilder
impl ServerBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ServerBuilder
.
Sourcepub async fn local(self, addr: SocketAddr) -> Result<Self>
pub async fn local(self, addr: SocketAddr) -> Result<Self>
Configures the local cache gRPC server.
Returns an error if the provided address cannot be bound.
Sourcepub async fn remote(self, addr: SocketAddr) -> Result<Self>
pub async fn remote(self, addr: SocketAddr) -> Result<Self>
Configures the remote cache gRPC server.
Returns an error if the provided address cannot be bound.
Sourcepub fn local_with_incoming(self, incoming: TcpListener) -> Self
pub fn local_with_incoming(self, incoming: TcpListener) -> Self
Configures the local cache gRPC server to use the provided [TcpListener
].
Sourcepub fn remote_with_incoming(self, incoming: TcpListener) -> Self
pub fn remote_with_incoming(self, incoming: TcpListener) -> Self
Configures the remote cache gRPC server to use the provided [TcpListener
].
Sourcepub fn heartbeat_interval(self, duration: Duration) -> Self
pub fn heartbeat_interval(self, duration: Duration) -> Self
Sets the expected interval between hearbeats.
Defaults to HEARTBEAT_INTERVAL_SECS_DEFAULT
.
Sourcepub fn heartbeat_timeout(self, duration: Duration) -> Self
pub fn heartbeat_timeout(self, duration: Duration) -> Self
Sets the timeout before an assigned task is marked for reassignment.
Defaults to HEARTBEAT_TIMEOUT_SECS_DEFAULT
.
Trait Implementations§
Source§impl Debug for ServerBuilder
impl Debug for ServerBuilder
Source§impl Default for ServerBuilder
impl Default for ServerBuilder
Source§fn default() -> ServerBuilder
fn default() -> ServerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for ServerBuilder
impl RefUnwindSafe for ServerBuilder
impl Send for ServerBuilder
impl Sync for ServerBuilder
impl Unpin for ServerBuilder
impl UnwindSafe for ServerBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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