#[non_exhaustive]pub struct ProcessOptions {
pub ocr_config: Option<OcrConfig>,
pub layout_config: Option<LayoutConfig>,
pub schema_override: Option<DocumentSchema>,
pub page_range: Option<PageRange>,
/* private fields */
}Expand description
Options for Process API
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.ocr_config: Option<OcrConfig>Only applicable to OCR_PROCESSOR and FORM_PARSER_PROCESSOR.
Returns error if set on other processor types.
layout_config: Option<LayoutConfig>Optional. Only applicable to LAYOUT_PARSER_PROCESSOR.
Returns error if set on other processor types.
schema_override: Option<DocumentSchema>Optional. Override the schema of the ProcessorVersion. Will return an Invalid Argument error if this field is set when the underlying ProcessorVersion doesn’t support schema override.
page_range: Option<PageRange>A subset of pages to process. If not specified, all pages are processed. If a page range is set, only the given pages are extracted and processed from the document. In the output document, Document.Page.page_number refers to the page number in the original document. This configuration only applies to online processing with ProcessDocument.
Implementations§
Source§impl ProcessOptions
impl ProcessOptions
Sourcepub fn set_ocr_config<T>(self, v: T) -> Self
pub fn set_ocr_config<T>(self, v: T) -> Self
Sets the value of ocr_config.
§Example
use google_cloud_documentai_v1::model::OcrConfig;
let x = ProcessOptions::new().set_ocr_config(OcrConfig::default()/* use setters */);Sourcepub fn set_or_clear_ocr_config<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_ocr_config<T>(self, v: Option<T>) -> Self
Sets or clears the value of ocr_config.
§Example
use google_cloud_documentai_v1::model::OcrConfig;
let x = ProcessOptions::new().set_or_clear_ocr_config(Some(OcrConfig::default()/* use setters */));
let x = ProcessOptions::new().set_or_clear_ocr_config(None::<OcrConfig>);Sourcepub fn set_layout_config<T>(self, v: T) -> Selfwhere
T: Into<LayoutConfig>,
pub fn set_layout_config<T>(self, v: T) -> Selfwhere
T: Into<LayoutConfig>,
Sets the value of layout_config.
§Example
use google_cloud_documentai_v1::model::process_options::LayoutConfig;
let x = ProcessOptions::new().set_layout_config(LayoutConfig::default()/* use setters */);Sourcepub fn set_or_clear_layout_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<LayoutConfig>,
pub fn set_or_clear_layout_config<T>(self, v: Option<T>) -> Selfwhere
T: Into<LayoutConfig>,
Sets or clears the value of layout_config.
§Example
use google_cloud_documentai_v1::model::process_options::LayoutConfig;
let x = ProcessOptions::new().set_or_clear_layout_config(Some(LayoutConfig::default()/* use setters */));
let x = ProcessOptions::new().set_or_clear_layout_config(None::<LayoutConfig>);Sourcepub fn set_schema_override<T>(self, v: T) -> Selfwhere
T: Into<DocumentSchema>,
pub fn set_schema_override<T>(self, v: T) -> Selfwhere
T: Into<DocumentSchema>,
Sets the value of schema_override.
§Example
use google_cloud_documentai_v1::model::DocumentSchema;
let x = ProcessOptions::new().set_schema_override(DocumentSchema::default()/* use setters */);Sourcepub fn set_or_clear_schema_override<T>(self, v: Option<T>) -> Selfwhere
T: Into<DocumentSchema>,
pub fn set_or_clear_schema_override<T>(self, v: Option<T>) -> Selfwhere
T: Into<DocumentSchema>,
Sets or clears the value of schema_override.
§Example
use google_cloud_documentai_v1::model::DocumentSchema;
let x = ProcessOptions::new().set_or_clear_schema_override(Some(DocumentSchema::default()/* use setters */));
let x = ProcessOptions::new().set_or_clear_schema_override(None::<DocumentSchema>);Sourcepub fn set_page_range<T: Into<Option<PageRange>>>(self, v: T) -> Self
pub fn set_page_range<T: Into<Option<PageRange>>>(self, v: T) -> Self
Sets the value of page_range.
Note that all the setters affecting page_range are mutually
exclusive.
§Example
use google_cloud_documentai_v1::model::process_options::PageRange;
let x = ProcessOptions::new().set_page_range(Some(PageRange::FromStart(42)));Sourcepub fn individual_page_selector(&self) -> Option<&Box<IndividualPageSelector>>
pub fn individual_page_selector(&self) -> Option<&Box<IndividualPageSelector>>
The value of page_range
if it holds a IndividualPageSelector, None if the field is not set or
holds a different branch.
Sourcepub fn set_individual_page_selector<T: Into<Box<IndividualPageSelector>>>(
self,
v: T,
) -> Self
pub fn set_individual_page_selector<T: Into<Box<IndividualPageSelector>>>( self, v: T, ) -> Self
Sets the value of page_range
to hold a IndividualPageSelector.
Note that all the setters affecting page_range are
mutually exclusive.
§Example
use google_cloud_documentai_v1::model::process_options::IndividualPageSelector;
let x = ProcessOptions::new().set_individual_page_selector(IndividualPageSelector::default()/* use setters */);
assert!(x.individual_page_selector().is_some());
assert!(x.from_start().is_none());
assert!(x.from_end().is_none());Sourcepub fn from_start(&self) -> Option<&i32>
pub fn from_start(&self) -> Option<&i32>
The value of page_range
if it holds a FromStart, None if the field is not set or
holds a different branch.
Sourcepub fn set_from_start<T: Into<i32>>(self, v: T) -> Self
pub fn set_from_start<T: Into<i32>>(self, v: T) -> Self
Sets the value of page_range
to hold a FromStart.
Note that all the setters affecting page_range are
mutually exclusive.
§Example
let x = ProcessOptions::new().set_from_start(42);
assert!(x.from_start().is_some());
assert!(x.individual_page_selector().is_none());
assert!(x.from_end().is_none());Sourcepub fn from_end(&self) -> Option<&i32>
pub fn from_end(&self) -> Option<&i32>
The value of page_range
if it holds a FromEnd, None if the field is not set or
holds a different branch.
Sourcepub fn set_from_end<T: Into<i32>>(self, v: T) -> Self
pub fn set_from_end<T: Into<i32>>(self, v: T) -> Self
Sets the value of page_range
to hold a FromEnd.
Note that all the setters affecting page_range are
mutually exclusive.
§Example
let x = ProcessOptions::new().set_from_end(42);
assert!(x.from_end().is_some());
assert!(x.individual_page_selector().is_none());
assert!(x.from_start().is_none());Trait Implementations§
Source§impl Clone for ProcessOptions
impl Clone for ProcessOptions
Source§fn clone(&self) -> ProcessOptions
fn clone(&self) -> ProcessOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProcessOptions
impl Debug for ProcessOptions
Source§impl Default for ProcessOptions
impl Default for ProcessOptions
Source§fn default() -> ProcessOptions
fn default() -> ProcessOptions
Source§impl Message for ProcessOptions
impl Message for ProcessOptions
Source§impl PartialEq for ProcessOptions
impl PartialEq for ProcessOptions
impl StructuralPartialEq for ProcessOptions
Auto Trait Implementations§
impl Freeze for ProcessOptions
impl RefUnwindSafe for ProcessOptions
impl Send for ProcessOptions
impl Sync for ProcessOptions
impl Unpin for ProcessOptions
impl UnsafeUnpin for ProcessOptions
impl UnwindSafe for ProcessOptions
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<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> 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