pub struct LinksClient<T> {
inner: Grpc<T>,
}
Expand description
The links gRPC API, providing a remote interface to the backend store. This
RPC interface roughly mimics links::store::Store
.
Fields§
§inner: Grpc<T>
Implementations§
Source§impl LinksClient<Channel>
impl LinksClient<Channel>
Source§impl<T> LinksClient<T>where
T: GrpcService<BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> LinksClient<T>where
T: GrpcService<BoxBody>,
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,
) -> LinksClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>,
<T as Service<Request<BoxBody>>>::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 get_redirect(
&mut self,
request: impl IntoRequest<GetRedirectRequest>,
) -> Result<Response<GetRedirectResponse>, Status>
pub async fn get_redirect( &mut self, request: impl IntoRequest<GetRedirectRequest>, ) -> Result<Response<GetRedirectResponse>, Status>
Get the link corresponding to the id.
Sourcepub async fn set_redirect(
&mut self,
request: impl IntoRequest<SetRedirectRequest>,
) -> Result<Response<SetRedirectResponse>, Status>
pub async fn set_redirect( &mut self, request: impl IntoRequest<SetRedirectRequest>, ) -> Result<Response<SetRedirectResponse>, Status>
Set a redirect by its id and link. Returns the old link, if any.
Sourcepub async fn rem_redirect(
&mut self,
request: impl IntoRequest<RemRedirectRequest>,
) -> Result<Response<RemRedirectResponse>, Status>
pub async fn rem_redirect( &mut self, request: impl IntoRequest<RemRedirectRequest>, ) -> Result<Response<RemRedirectResponse>, Status>
Remove a redirect by its id. Returns the old link, if any.
Sourcepub async fn get_vanity(
&mut self,
request: impl IntoRequest<GetVanityRequest>,
) -> Result<Response<GetVanityResponse>, Status>
pub async fn get_vanity( &mut self, request: impl IntoRequest<GetVanityRequest>, ) -> Result<Response<GetVanityResponse>, Status>
Get the id corresponding to the vanity path.
Sourcepub async fn set_vanity(
&mut self,
request: impl IntoRequest<SetVanityRequest>,
) -> Result<Response<SetVanityResponse>, Status>
pub async fn set_vanity( &mut self, request: impl IntoRequest<SetVanityRequest>, ) -> Result<Response<SetVanityResponse>, Status>
Set a vanity redirect by its path and id. Returns the old id, if any.
Sourcepub async fn rem_vanity(
&mut self,
request: impl IntoRequest<RemVanityRequest>,
) -> Result<Response<RemVanityResponse>, Status>
pub async fn rem_vanity( &mut self, request: impl IntoRequest<RemVanityRequest>, ) -> Result<Response<RemVanityResponse>, Status>
Remove a vanity path by its text content. Returns the old id, if any.
Sourcepub async fn get_statistics(
&mut self,
request: impl IntoRequest<GetStatisticsRequest>,
) -> Result<Response<GetStatisticsResponse>, Status>
pub async fn get_statistics( &mut self, request: impl IntoRequest<GetStatisticsRequest>, ) -> Result<Response<GetStatisticsResponse>, Status>
Get statistics’ counts.
Sourcepub async fn rem_statistics(
&mut self,
request: impl IntoRequest<RemStatisticsRequest>,
) -> Result<Response<RemStatisticsResponse>, Status>
pub async fn rem_statistics( &mut self, request: impl IntoRequest<RemStatisticsRequest>, ) -> Result<Response<RemStatisticsResponse>, Status>
Remove statistics. Returns the old counts, if available.
Trait Implementations§
Source§impl<T: Clone> Clone for LinksClient<T>
impl<T: Clone> Clone for LinksClient<T>
Source§fn clone(&self) -> LinksClient<T>
fn clone(&self) -> LinksClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<T> !Freeze for LinksClient<T>
impl<T> RefUnwindSafe for LinksClient<T>where
T: RefUnwindSafe,
impl<T> Send for LinksClient<T>where
T: Send,
impl<T> Sync for LinksClient<T>where
T: Sync,
impl<T> Unpin for LinksClient<T>where
T: Unpin,
impl<T> UnwindSafe for LinksClient<T>where
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,
§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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§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