Struct cache::persistent::server::ServerBuilder
source · 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 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