pub trait LanguageService:
Debug
+ Send
+ Sync {
// Provided methods
fn analyze_sentiment(
&self,
_req: AnalyzeSentimentRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnalyzeSentimentResponse>> + Send { ... }
fn analyze_entities(
&self,
_req: AnalyzeEntitiesRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnalyzeEntitiesResponse>> + Send { ... }
fn classify_text(
&self,
_req: ClassifyTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<ClassifyTextResponse>> + Send { ... }
fn moderate_text(
&self,
_req: ModerateTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<ModerateTextResponse>> + Send { ... }
fn annotate_text(
&self,
_req: AnnotateTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnnotateTextResponse>> + Send { ... }
}Expand description
Defines the trait used to implement crate::client::LanguageService.
Application developers may need to implement this trait to mock
client::LanguageService. In other use-cases, application developers only
use client::LanguageService and need not be concerned with this trait or
its implementations.
Services gain new RPCs routinely. Consequently, this trait gains new methods too. To avoid breaking applications the trait provides a default implementation of each method. Most of these implementations just return an error.
Provided Methods§
Sourcefn analyze_sentiment(
&self,
_req: AnalyzeSentimentRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnalyzeSentimentResponse>> + Send
fn analyze_sentiment( &self, _req: AnalyzeSentimentRequest, _options: RequestOptions, ) -> impl Future<Output = Result<AnalyzeSentimentResponse>> + Send
Sourcefn analyze_entities(
&self,
_req: AnalyzeEntitiesRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnalyzeEntitiesResponse>> + Send
fn analyze_entities( &self, _req: AnalyzeEntitiesRequest, _options: RequestOptions, ) -> impl Future<Output = Result<AnalyzeEntitiesResponse>> + Send
Implements crate::client::LanguageService::analyze_entities.
Sourcefn classify_text(
&self,
_req: ClassifyTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<ClassifyTextResponse>> + Send
fn classify_text( &self, _req: ClassifyTextRequest, _options: RequestOptions, ) -> impl Future<Output = Result<ClassifyTextResponse>> + Send
Implements crate::client::LanguageService::classify_text.
Sourcefn moderate_text(
&self,
_req: ModerateTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<ModerateTextResponse>> + Send
fn moderate_text( &self, _req: ModerateTextRequest, _options: RequestOptions, ) -> impl Future<Output = Result<ModerateTextResponse>> + Send
Implements crate::client::LanguageService::moderate_text.
Sourcefn annotate_text(
&self,
_req: AnnotateTextRequest,
_options: RequestOptions,
) -> impl Future<Output = Result<AnnotateTextResponse>> + Send
fn annotate_text( &self, _req: AnnotateTextRequest, _options: RequestOptions, ) -> impl Future<Output = Result<AnnotateTextResponse>> + Send
Implements crate::client::LanguageService::annotate_text.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.