Struct rusoto_textract::TextractClient
source · [−]pub struct TextractClient { /* private fields */ }
Expand description
A client for the Amazon Textract API.
Implementations
sourceimpl TextractClient
impl TextractClient
sourcepub fn new(region: Region) -> TextractClient
pub fn new(region: Region) -> TextractClient
Creates a client backed by the default tokio event loop.
The client will use the default credentials provider and tls client.
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: Region
) -> TextractClient where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
pub fn new_with_client(client: Client, region: Region) -> TextractClient
Trait Implementations
sourceimpl Clone for TextractClient
impl Clone for TextractClient
sourcefn clone(&self) -> TextractClient
fn clone(&self) -> TextractClient
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Textract for TextractClient
impl Textract for TextractClient
sourcefn analyze_document<'life0, 'async_trait>(
&'life0 self,
input: AnalyzeDocumentRequest
) -> Pin<Box<dyn Future<Output = Result<AnalyzeDocumentResponse, RusotoError<AnalyzeDocumentError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn analyze_document<'life0, 'async_trait>(
&'life0 self,
input: AnalyzeDocumentRequest
) -> Pin<Box<dyn Future<Output = Result<AnalyzeDocumentResponse, RusotoError<AnalyzeDocumentError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Analyzes an input document for relationships between detected items.
The types of information returned are as follows:
-
Form data (key-value pairs). The related information is returned in two Block objects, each of type
KEY_VALUE_SET
: a KEYBlock
object and a VALUEBlock
object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. -
Table and table cell data. A TABLE
Block
object contains information about a detected table. A CELLBlock
object is returned for each cell in a table. -
Lines and words of text. A LINE
Block
object contains one or more WORDBlock
objects. All lines and words that are detected in the document are returned (including text that doesn't have a relationship with the value ofFeatureTypes
).
Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables. A SELECTION_ELEMENT Block
object contains information about a selection element, including the selection status.
You can choose which type of analysis to perform by specifying the FeatureTypes
list.
The output is returned in a list of Block
objects.
AnalyzeDocument
is a synchronous operation. To analyze documents asynchronously, use StartDocumentAnalysis.
For more information, see Document Text Analysis.
sourcefn detect_document_text<'life0, 'async_trait>(
&'life0 self,
input: DetectDocumentTextRequest
) -> Pin<Box<dyn Future<Output = Result<DetectDocumentTextResponse, RusotoError<DetectDocumentTextError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn detect_document_text<'life0, 'async_trait>(
&'life0 self,
input: DetectDocumentTextRequest
) -> Pin<Box<dyn Future<Output = Result<DetectDocumentTextResponse, RusotoError<DetectDocumentTextError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Detects text in the input document. Amazon Textract can detect lines of text and the words that make up a line of text. The input document must be an image in JPEG or PNG format. DetectDocumentText
returns the detected text in an array of Block objects.
Each document page has as an associated Block
of type PAGE. Each PAGE Block
object is the parent of LINE Block
objects that represent the lines of detected text on a page. A LINE Block
object is a parent for each word that makes up the line. Words are represented by Block
objects of type WORD.
DetectDocumentText
is a synchronous operation. To analyze documents asynchronously, use StartDocumentTextDetection.
For more information, see Document Text Detection.
sourcefn get_document_analysis<'life0, 'async_trait>(
&'life0 self,
input: GetDocumentAnalysisRequest
) -> Pin<Box<dyn Future<Output = Result<GetDocumentAnalysisResponse, RusotoError<GetDocumentAnalysisError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_document_analysis<'life0, 'async_trait>(
&'life0 self,
input: GetDocumentAnalysisRequest
) -> Pin<Box<dyn Future<Output = Result<GetDocumentAnalysisResponse, RusotoError<GetDocumentAnalysisError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Gets the results for an Amazon Textract asynchronous operation that analyzes text in a document.
You start asynchronous text analysis by calling StartDocumentAnalysis, which returns a job identifier (JobId
). When the text analysis operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentAnalysis
. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call GetDocumentAnalysis
, and pass the job identifier (JobId
) from the initial call to StartDocumentAnalysis
.
GetDocumentAnalysis
returns an array of Block objects. The following types of information are returned:
-
Form data (key-value pairs). The related information is returned in two Block objects, each of type
KEY_VALUE_SET
: a KEYBlock
object and a VALUEBlock
object. For example, Name: Ana Silva Carolina contains a key and value. Name: is the key. Ana Silva Carolina is the value. -
Table and table cell data. A TABLE
Block
object contains information about a detected table. A CELLBlock
object is returned for each cell in a table. -
Lines and words of text. A LINE
Block
object contains one or more WORDBlock
objects. All lines and words that are detected in the document are returned (including text that doesn't have a relationship with the value of theStartDocumentAnalysis
FeatureTypes
input parameter).
Selection elements such as check boxes and option buttons (radio buttons) can be detected in form data and in tables. A SELECTION_ELEMENT Block
object contains information about a selection element, including the selection status.
Use the MaxResults
parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults
, the value of NextToken
in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentAnalysis
, and populate the NextToken
request parameter with the token value that's returned from the previous call to GetDocumentAnalysis
.
For more information, see Document Text Analysis.
sourcefn get_document_text_detection<'life0, 'async_trait>(
&'life0 self,
input: GetDocumentTextDetectionRequest
) -> Pin<Box<dyn Future<Output = Result<GetDocumentTextDetectionResponse, RusotoError<GetDocumentTextDetectionError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_document_text_detection<'life0, 'async_trait>(
&'life0 self,
input: GetDocumentTextDetectionRequest
) -> Pin<Box<dyn Future<Output = Result<GetDocumentTextDetectionResponse, RusotoError<GetDocumentTextDetectionError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Gets the results for an Amazon Textract asynchronous operation that detects text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.
You start asynchronous text detection by calling StartDocumentTextDetection, which returns a job identifier (JobId
). When the text detection operation finishes, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that's registered in the initial call to StartDocumentTextDetection
. To get the results of the text-detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call GetDocumentTextDetection
, and pass the job identifier (JobId
) from the initial call to StartDocumentTextDetection
.
GetDocumentTextDetection
returns an array of Block objects.
Each document page has as an associated Block
of type PAGE. Each PAGE Block
object is the parent of LINE Block
objects that represent the lines of detected text on a page. A LINE Block
object is a parent for each word that makes up the line. Words are represented by Block
objects of type WORD.
Use the MaxResults parameter to limit the number of blocks that are returned. If there are more results than specified in MaxResults
, the value of NextToken
in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetDocumentTextDetection
, and populate the NextToken
request parameter with the token value that's returned from the previous call to GetDocumentTextDetection
.
For more information, see Document Text Detection.
sourcefn start_document_analysis<'life0, 'async_trait>(
&'life0 self,
input: StartDocumentAnalysisRequest
) -> Pin<Box<dyn Future<Output = Result<StartDocumentAnalysisResponse, RusotoError<StartDocumentAnalysisError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn start_document_analysis<'life0, 'async_trait>(
&'life0 self,
input: StartDocumentAnalysisRequest
) -> Pin<Box<dyn Future<Output = Result<StartDocumentAnalysisResponse, RusotoError<StartDocumentAnalysisError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Starts the asynchronous analysis of an input document for relationships between detected items such as key-value pairs, tables, and selection elements.
StartDocumentAnalysis
can analyze text in documents that are in JPEG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.
StartDocumentAnalysis
returns a job identifier (JobId
) that you use to get the results of the operation. When text analysis is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the results of the text analysis operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call GetDocumentAnalysis, and pass the job identifier (JobId
) from the initial call to StartDocumentAnalysis
.
For more information, see Document Text Analysis.
sourcefn start_document_text_detection<'life0, 'async_trait>(
&'life0 self,
input: StartDocumentTextDetectionRequest
) -> Pin<Box<dyn Future<Output = Result<StartDocumentTextDetectionResponse, RusotoError<StartDocumentTextDetectionError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn start_document_text_detection<'life0, 'async_trait>(
&'life0 self,
input: StartDocumentTextDetectionRequest
) -> Pin<Box<dyn Future<Output = Result<StartDocumentTextDetectionResponse, RusotoError<StartDocumentTextDetectionError>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Starts the asynchronous detection of text in a document. Amazon Textract can detect lines of text and the words that make up a line of text.
StartDocumentTextDetection
can analyze text in documents that are in JPEG, PNG, and PDF format. The documents are stored in an Amazon S3 bucket. Use DocumentLocation to specify the bucket name and file name of the document.
StartTextDetection
returns a job identifier (JobId
) that you use to get the results of the operation. When text detection is finished, Amazon Textract publishes a completion status to the Amazon Simple Notification Service (Amazon SNS) topic that you specify in NotificationChannel
. To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED
. If so, call GetDocumentTextDetection, and pass the job identifier (JobId
) from the initial call to StartDocumentTextDetection
.
For more information, see Document Text Detection.
Auto Trait Implementations
impl !RefUnwindSafe for TextractClient
impl Send for TextractClient
impl Sync for TextractClient
impl Unpin for TextractClient
impl !UnwindSafe for TextractClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more