pub struct DocumentMethods<'a, C>where
C: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on document resources.
It is not used directly, but through the CloudNaturalLanguage
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_language1 as language1;
use language1::{CloudNaturalLanguage, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = CloudNaturalLanguage::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `analyze_entities(...)`, `analyze_entity_sentiment(...)`, `analyze_sentiment(...)`, `analyze_syntax(...)`, `annotate_text(...)`, `classify_text(...)` and `moderate_text(...)`
// to build up your call.
let rb = hub.documents();
Implementations§
Source§impl<'a, C> DocumentMethods<'a, C>
impl<'a, C> DocumentMethods<'a, C>
Sourcepub fn analyze_entities(
&self,
request: AnalyzeEntitiesRequest,
) -> DocumentAnalyzeEntityCall<'a, C>
pub fn analyze_entities( &self, request: AnalyzeEntitiesRequest, ) -> DocumentAnalyzeEntityCall<'a, C>
Create a builder to help you perform the following task:
Finds named entities (currently proper names and common nouns) in the text along with entity types, salience, mentions for each entity, and other properties.
§Arguments
request
- No description provided.
Sourcepub fn analyze_entity_sentiment(
&self,
request: AnalyzeEntitySentimentRequest,
) -> DocumentAnalyzeEntitySentimentCall<'a, C>
pub fn analyze_entity_sentiment( &self, request: AnalyzeEntitySentimentRequest, ) -> DocumentAnalyzeEntitySentimentCall<'a, C>
Create a builder to help you perform the following task:
Finds entities, similar to AnalyzeEntities in the text and analyzes sentiment associated with each entity and its mentions.
§Arguments
request
- No description provided.
Sourcepub fn analyze_sentiment(
&self,
request: AnalyzeSentimentRequest,
) -> DocumentAnalyzeSentimentCall<'a, C>
pub fn analyze_sentiment( &self, request: AnalyzeSentimentRequest, ) -> DocumentAnalyzeSentimentCall<'a, C>
Create a builder to help you perform the following task:
Analyzes the sentiment of the provided text.
§Arguments
request
- No description provided.
Sourcepub fn analyze_syntax(
&self,
request: AnalyzeSyntaxRequest,
) -> DocumentAnalyzeSyntaxCall<'a, C>
pub fn analyze_syntax( &self, request: AnalyzeSyntaxRequest, ) -> DocumentAnalyzeSyntaxCall<'a, C>
Create a builder to help you perform the following task:
Analyzes the syntax of the text and provides sentence boundaries and tokenization along with part of speech tags, dependency trees, and other properties.
§Arguments
request
- No description provided.
Sourcepub fn annotate_text(
&self,
request: AnnotateTextRequest,
) -> DocumentAnnotateTextCall<'a, C>
pub fn annotate_text( &self, request: AnnotateTextRequest, ) -> DocumentAnnotateTextCall<'a, C>
Create a builder to help you perform the following task:
A convenience method that provides all the features that analyzeSentiment, analyzeEntities, and analyzeSyntax provide in one call.
§Arguments
request
- No description provided.
Sourcepub fn classify_text(
&self,
request: ClassifyTextRequest,
) -> DocumentClassifyTextCall<'a, C>
pub fn classify_text( &self, request: ClassifyTextRequest, ) -> DocumentClassifyTextCall<'a, C>
Create a builder to help you perform the following task:
Classifies a document into categories.
§Arguments
request
- No description provided.
Sourcepub fn moderate_text(
&self,
request: ModerateTextRequest,
) -> DocumentModerateTextCall<'a, C>
pub fn moderate_text( &self, request: ModerateTextRequest, ) -> DocumentModerateTextCall<'a, C>
Create a builder to help you perform the following task:
Moderates a document for harmful and sensitive categories.
§Arguments
request
- No description provided.
Trait Implementations§
impl<'a, C> MethodsBuilder for DocumentMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for DocumentMethods<'a, C>
impl<'a, C> !RefUnwindSafe for DocumentMethods<'a, C>
impl<'a, C> Send for DocumentMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for DocumentMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for DocumentMethods<'a, C>
impl<'a, C> !UnwindSafe for DocumentMethods<'a, C>
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> 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 more