pub struct ReplicationServiceClient<T> { /* private fields */ }Expand description
A standby follows its primary. The standby’s key needs a grant for replicate (*): the
stream carries every record of the primary’s store, with the vault values and files they
refer to, in plaintext, so run it over mutual TLS only.
Implementations§
Source§impl<T> ReplicationServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> ReplicationServiceClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> ReplicationServiceClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn follow(
&mut self,
request: impl IntoStreamingRequest<Message = FollowRequest>,
) -> Result<Response<Streaming<FollowResponse>>, Status>
pub async fn follow( &mut self, request: impl IntoStreamingRequest<Message = FollowRequest>, ) -> Result<Response<Streaming<FollowResponse>>, Status>
FollowRequest.hello -> FollowResponse.challenge -> FollowRequest.challenge_response -> FollowResponse.start, then either an image (image…, image_end) or straight records; the standby acknowledges what it applied and synced.
Sourcepub async fn promote(
&mut self,
request: impl IntoRequest<PromoteRequest>,
) -> Result<Response<PromoteResult>, Status>
pub async fn promote( &mut self, request: impl IntoRequest<PromoteRequest>, ) -> Result<Response<PromoteResult>, Status>
Asked of a standby: stop following and serve as the primary. Signed by a key granted
manage for *, over kernable.v1.promote, valid 60 s around issued_at.
Sourcepub async fn switchover(
&mut self,
request: impl IntoRequest<SwitchoverRequest>,
) -> Result<Response<SwitchoverResult>, Status>
pub async fn switchover( &mut self, request: impl IntoRequest<SwitchoverRequest>, ) -> Result<Response<SwitchoverResult>, Status>
Asked of a primary with a standby in sync: hand the primary role over to it now. The
primary refuses new requests (UNAVAILABLE), lets running ones finish, and waits until the
standby holds every record. In a pair it then tells the witness HANDOVER and the
standby claims at once; without a witness it sends the standby TAKE_OVER on its stream, and
the standby takes over. Either way the old primary stops, and never serves as the primary
again unless started to follow. Signed by a key granted manage for *, over
kernable.v1.switchover, valid 60 s around issued_at. FAILED_PRECONDITION: no standby in
sync, or the standby did not catch up in time (the primary then serves on).
Trait Implementations§
Source§impl<T: Clone> Clone for ReplicationServiceClient<T>
impl<T: Clone> Clone for ReplicationServiceClient<T>
Auto Trait Implementations§
impl<T> !Freeze for ReplicationServiceClient<T>
impl<T> Forget for ReplicationServiceClient<T>
impl<T> Move for ReplicationServiceClient<T>
impl<T> RefUnwindSafe for ReplicationServiceClient<T>where
Grpc<T>: RefUnwindSafe,
impl<T> Send for ReplicationServiceClient<T>
impl<T> Sync for ReplicationServiceClient<T>
impl<T> Unpin for ReplicationServiceClient<T>
impl<T> UnsafeUnpin for ReplicationServiceClient<T>where
Grpc<T>: UnsafeUnpin,
impl<T> UnwindSafe for ReplicationServiceClient<T>where
Grpc<T>: UnwindSafe,
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
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>
T in a tonic::Request