Struct google_api_proto::google::cloud::translation::v3beta1::translation_service_client::TranslationServiceClient
source · pub struct TranslationServiceClient<T> { /* private fields */ }
Expand description
Provides natural language translation operations.
Implementations§
source§impl<T> TranslationServiceClient<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> TranslationServiceClient<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,
) -> TranslationServiceClient<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 translate_text(
&mut self,
request: impl IntoRequest<TranslateTextRequest>,
) -> Result<Response<TranslateTextResponse>, Status>
pub async fn translate_text( &mut self, request: impl IntoRequest<TranslateTextRequest>, ) -> Result<Response<TranslateTextResponse>, Status>
Translates input text and returns translated text.
sourcepub async fn detect_language(
&mut self,
request: impl IntoRequest<DetectLanguageRequest>,
) -> Result<Response<DetectLanguageResponse>, Status>
pub async fn detect_language( &mut self, request: impl IntoRequest<DetectLanguageRequest>, ) -> Result<Response<DetectLanguageResponse>, Status>
Detects the language of text within a request.
sourcepub async fn get_supported_languages(
&mut self,
request: impl IntoRequest<GetSupportedLanguagesRequest>,
) -> Result<Response<SupportedLanguages>, Status>
pub async fn get_supported_languages( &mut self, request: impl IntoRequest<GetSupportedLanguagesRequest>, ) -> Result<Response<SupportedLanguages>, Status>
Returns a list of supported languages for translation.
sourcepub async fn translate_document(
&mut self,
request: impl IntoRequest<TranslateDocumentRequest>,
) -> Result<Response<TranslateDocumentResponse>, Status>
pub async fn translate_document( &mut self, request: impl IntoRequest<TranslateDocumentRequest>, ) -> Result<Response<TranslateDocumentResponse>, Status>
Translates documents in synchronous mode.
sourcepub async fn batch_translate_text(
&mut self,
request: impl IntoRequest<BatchTranslateTextRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_translate_text( &mut self, request: impl IntoRequest<BatchTranslateTextRequest>, ) -> Result<Response<Operation>, Status>
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it’s all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
sourcepub async fn batch_translate_document(
&mut self,
request: impl IntoRequest<BatchTranslateDocumentRequest>,
) -> Result<Response<Operation>, Status>
pub async fn batch_translate_document( &mut self, request: impl IntoRequest<BatchTranslateDocumentRequest>, ) -> Result<Response<Operation>, Status>
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it’s all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
sourcepub async fn create_glossary(
&mut self,
request: impl IntoRequest<CreateGlossaryRequest>,
) -> Result<Response<Operation>, Status>
pub async fn create_glossary( &mut self, request: impl IntoRequest<CreateGlossaryRequest>, ) -> Result<Response<Operation>, Status>
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn’t exist.
sourcepub async fn list_glossaries(
&mut self,
request: impl IntoRequest<ListGlossariesRequest>,
) -> Result<Response<ListGlossariesResponse>, Status>
pub async fn list_glossaries( &mut self, request: impl IntoRequest<ListGlossariesRequest>, ) -> Result<Response<ListGlossariesResponse>, Status>
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn’t exist.
sourcepub async fn get_glossary(
&mut self,
request: impl IntoRequest<GetGlossaryRequest>,
) -> Result<Response<Glossary>, Status>
pub async fn get_glossary( &mut self, request: impl IntoRequest<GetGlossaryRequest>, ) -> Result<Response<Glossary>, Status>
Gets a glossary. Returns NOT_FOUND, if the glossary doesn’t exist.
sourcepub async fn delete_glossary(
&mut self,
request: impl IntoRequest<DeleteGlossaryRequest>,
) -> Result<Response<Operation>, Status>
pub async fn delete_glossary( &mut self, request: impl IntoRequest<DeleteGlossaryRequest>, ) -> Result<Response<Operation>, Status>
Deletes a glossary, or cancels glossary construction if the glossary isn’t created yet. Returns NOT_FOUND, if the glossary doesn’t exist.
Trait Implementations§
source§impl<T: Clone> Clone for TranslationServiceClient<T>
impl<T: Clone> Clone for TranslationServiceClient<T>
source§fn clone(&self) -> TranslationServiceClient<T>
fn clone(&self) -> TranslationServiceClient<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 TranslationServiceClient<T>
impl<T> RefUnwindSafe for TranslationServiceClient<T>where
T: RefUnwindSafe,
impl<T> Send for TranslationServiceClient<T>where
T: Send,
impl<T> Sync for TranslationServiceClient<T>where
T: Sync,
impl<T> Unpin for TranslationServiceClient<T>where
T: Unpin,
impl<T> UnwindSafe for TranslationServiceClient<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
§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>
T
in a tonic::Request