#[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
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());
assert!(x.image_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());
assert!(x.image_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());
assert!(x.image_block().is_none());Sourcepub fn image_block(&self) -> Option<&Box<LayoutImageBlock>>
pub fn image_block(&self) -> Option<&Box<LayoutImageBlock>>
The value of block
if it holds a ImageBlock, None if the field is not set or
holds a different branch.
Sourcepub fn set_image_block<T: Into<Box<LayoutImageBlock>>>(self, v: T) -> Self
pub fn set_image_block<T: Into<Box<LayoutImageBlock>>>(self, v: T) -> Self
Sets the value of block
to hold a ImageBlock.
Note that all the setters affecting block are
mutually exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::LayoutImageBlock;
let x = DocumentLayoutBlock::new().set_image_block(LayoutImageBlock::default()/* use setters */);
assert!(x.image_block().is_some());
assert!(x.text_block().is_none());
assert!(x.table_block().is_none());
assert!(x.list_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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DocumentLayoutBlock
impl Debug for DocumentLayoutBlock
Source§impl Default for DocumentLayoutBlock
impl Default for DocumentLayoutBlock
Source§fn default() -> DocumentLayoutBlock
fn default() -> DocumentLayoutBlock
Source§impl Message for DocumentLayoutBlock
impl Message for DocumentLayoutBlock
Source§impl PartialEq for DocumentLayoutBlock
impl PartialEq for DocumentLayoutBlock
impl StructuralPartialEq for DocumentLayoutBlock
Auto Trait Implementations§
impl Freeze for DocumentLayoutBlock
impl RefUnwindSafe for DocumentLayoutBlock
impl Send for DocumentLayoutBlock
impl Sync for DocumentLayoutBlock
impl Unpin for DocumentLayoutBlock
impl UnsafeUnpin for DocumentLayoutBlock
impl UnwindSafe for DocumentLayoutBlock
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