#[non_exhaustive]pub struct Block {
pub property: Option<TextProperty>,
pub bounding_box: Option<BoundingPoly>,
pub paragraphs: Vec<Paragraph>,
pub block_type: BlockType,
pub confidence: f32,
/* private fields */
}Expand description
Logical element on the page.
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.property: Option<TextProperty>Additional information detected for the block.
bounding_box: Option<BoundingPoly>The bounding box for the block. The vertices are in the order of top-left, top-right, bottom-right, bottom-left. When a rotation of the bounding box is detected the rotation is represented as around the top-left corner as defined when the text is read in the ‘natural’ orientation. For example:
-
when the text is horizontal it might look like:
-
when it’s rotated 180 degrees around the top-left corner it becomes:
and the vertex order will still be (0, 1, 2, 3).
0----1
| |
3----2 2----3
| |
1----0paragraphs: Vec<Paragraph>List of paragraphs in this block (if this blocks is of type text).
block_type: BlockTypeDetected block type (text, image etc) for this block.
confidence: f32Confidence of the OCR results on the block. Range [0, 1].
Implementations§
Source§impl Block
impl Block
pub fn new() -> Self
Sourcepub fn set_property<T>(self, v: T) -> Selfwhere
T: Into<TextProperty>,
pub fn set_property<T>(self, v: T) -> Selfwhere
T: Into<TextProperty>,
Sets the value of property.
Sourcepub fn set_or_clear_property<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextProperty>,
pub fn set_or_clear_property<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextProperty>,
Sets or clears the value of property.
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.
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.
Sourcepub fn set_paragraphs<T, V>(self, v: T) -> Self
pub fn set_paragraphs<T, V>(self, v: T) -> Self
Sets the value of paragraphs.
Sourcepub fn set_block_type<T: Into<BlockType>>(self, v: T) -> Self
pub fn set_block_type<T: Into<BlockType>>(self, v: T) -> Self
Sets the value of block_type.
Sourcepub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
pub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
Sets the value of confidence.