#[non_exhaustive]pub struct DocumentLayoutBlock {
pub block_id: String,
pub page_span: Option<LayoutPageSpan>,
pub bounding_box: Option<BoundingPoly>,
pub block: Option<Block>,
/* private fields */
}Expand description
Represents a block. A block could be one of the various types (text, table, list) supported.
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.block_id: StringID of the block.
page_span: Option<LayoutPageSpan>Page span of the block.
bounding_box: Option<BoundingPoly>Identifies the bounding box for the block.
block: Option<Block>Implementations§
Source§impl DocumentLayoutBlock
impl DocumentLayoutBlock
pub fn new() -> Self
Sourcepub fn set_block_id<T: Into<String>>(self, v: T) -> Self
pub fn set_block_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_page_span<T>(self, v: T) -> Selfwhere
T: Into<LayoutPageSpan>,
pub fn set_page_span<T>(self, v: T) -> Selfwhere
T: Into<LayoutPageSpan>,
Sourcepub fn set_or_clear_page_span<T>(self, v: Option<T>) -> Selfwhere
T: Into<LayoutPageSpan>,
pub fn set_or_clear_page_span<T>(self, v: Option<T>) -> Selfwhere
T: Into<LayoutPageSpan>,
Sets or clears the value of page_span.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutPageSpan;
let x = DocumentLayoutBlock::new().set_or_clear_page_span(Some(LayoutPageSpan::default()/* use setters */));
let x = DocumentLayoutBlock::new().set_or_clear_page_span(None::<LayoutPageSpan>);Sourcepub fn set_bounding_box<T>(self, v: T) -> Selfwhere
T: Into<BoundingPoly>,
pub fn set_bounding_box<T>(self, v: T) -> Selfwhere
T: Into<BoundingPoly>,
Sets the value of bounding_box.
§Example
use google_cloud_documentai_v1::model::BoundingPoly;
let x = DocumentLayoutBlock::new().set_bounding_box(BoundingPoly::default()/* use setters */);Sourcepub fn set_or_clear_bounding_box<T>(self, v: Option<T>) -> Selfwhere
T: Into<BoundingPoly>,
pub fn set_or_clear_bounding_box<T>(self, v: Option<T>) -> Selfwhere
T: Into<BoundingPoly>,
Sets or clears the value of bounding_box.
§Example
use google_cloud_documentai_v1::model::BoundingPoly;
let x = DocumentLayoutBlock::new().set_or_clear_bounding_box(Some(BoundingPoly::default()/* use setters */));
let x = DocumentLayoutBlock::new().set_or_clear_bounding_box(None::<BoundingPoly>);Sourcepub fn set_block<T: Into<Option<Block>>>(self, v: T) -> Self
pub fn set_block<T: Into<Option<Block>>>(self, v: T) -> Self
Sets the value of block.
Note that all the setters affecting block are mutually
exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
let x = DocumentLayoutBlock::new().set_block(Some(
google_cloud_documentai_v1::model::document::document_layout::document_layout_block::Block::TextBlock(LayoutTextBlock::default().into())));Sourcepub fn text_block(&self) -> Option<&Box<LayoutTextBlock>>
pub fn text_block(&self) -> Option<&Box<LayoutTextBlock>>
The value of block
if it holds a TextBlock, None if the field is not set or
holds a different branch.
Sourcepub fn set_text_block<T: Into<Box<LayoutTextBlock>>>(self, v: T) -> Self
pub fn set_text_block<T: Into<Box<LayoutTextBlock>>>(self, v: T) -> Self
Sets the value of block
to hold a TextBlock.
Note that all the setters affecting block are
mutually exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTextBlock;
let x = DocumentLayoutBlock::new().set_text_block(LayoutTextBlock::default()/* use setters */);
assert!(x.text_block().is_some());
assert!(x.table_block().is_none());
assert!(x.list_block().is_none());Sourcepub fn table_block(&self) -> Option<&Box<LayoutTableBlock>>
pub fn table_block(&self) -> Option<&Box<LayoutTableBlock>>
The value of block
if it holds a TableBlock, None if the field is not set or
holds a different branch.
Sourcepub fn set_table_block<T: Into<Box<LayoutTableBlock>>>(self, v: T) -> Self
pub fn set_table_block<T: Into<Box<LayoutTableBlock>>>(self, v: T) -> Self
Sets the value of block
to hold a TableBlock.
Note that all the setters affecting block are
mutually exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutTableBlock;
let x = DocumentLayoutBlock::new().set_table_block(LayoutTableBlock::default()/* use setters */);
assert!(x.table_block().is_some());
assert!(x.text_block().is_none());
assert!(x.list_block().is_none());Sourcepub fn list_block(&self) -> Option<&Box<LayoutListBlock>>
pub fn list_block(&self) -> Option<&Box<LayoutListBlock>>
The value of block
if it holds a ListBlock, None if the field is not set or
holds a different branch.
Sourcepub fn set_list_block<T: Into<Box<LayoutListBlock>>>(self, v: T) -> Self
pub fn set_list_block<T: Into<Box<LayoutListBlock>>>(self, v: T) -> Self
Sets the value of block
to hold a ListBlock.
Note that all the setters affecting block are
mutually exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutListBlock;
let x = DocumentLayoutBlock::new().set_list_block(LayoutListBlock::default()/* use setters */);
assert!(x.list_block().is_some());
assert!(x.text_block().is_none());
assert!(x.table_block().is_none());Trait Implementations§
Source§impl Clone for DocumentLayoutBlock
impl Clone for DocumentLayoutBlock
Source§fn clone(&self) -> DocumentLayoutBlock
fn clone(&self) -> DocumentLayoutBlock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more