#[non_exhaustive]pub struct Layout {
pub text_anchor: Option<TextAnchor>,
pub confidence: f32,
pub bounding_poly: Option<BoundingPoly>,
pub orientation: Orientation,
/* private fields */
}Expand description
Visual element describing a layout unit on a page.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text_anchor: Option<TextAnchor>Text anchor indexing into the Document.text.
confidence: f32Confidence of the current
Layout within
context of the object this layout is for. e.g. confidence can be for a
single token, a table, a visual element, etc. depending on context.
Range [0, 1].
bounding_poly: Option<BoundingPoly>The bounding polygon for the Layout.
orientation: OrientationDetected orientation for the Layout.
Implementations§
Source§impl Layout
impl Layout
pub fn new() -> Self
Sourcepub fn set_text_anchor<T>(self, v: T) -> Selfwhere
T: Into<TextAnchor>,
pub fn set_text_anchor<T>(self, v: T) -> Selfwhere
T: Into<TextAnchor>,
Sets the value of text_anchor.
Sourcepub fn set_or_clear_text_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextAnchor>,
pub fn set_or_clear_text_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<TextAnchor>,
Sets or clears the value of text_anchor.
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.
Sourcepub fn set_bounding_poly<T>(self, v: T) -> Selfwhere
T: Into<BoundingPoly>,
pub fn set_bounding_poly<T>(self, v: T) -> Selfwhere
T: Into<BoundingPoly>,
Sets the value of bounding_poly.
Sourcepub fn set_or_clear_bounding_poly<T>(self, v: Option<T>) -> Selfwhere
T: Into<BoundingPoly>,
pub fn set_or_clear_bounding_poly<T>(self, v: Option<T>) -> Selfwhere
T: Into<BoundingPoly>,
Sets or clears the value of bounding_poly.
Sourcepub fn set_orientation<T: Into<Orientation>>(self, v: T) -> Self
pub fn set_orientation<T: Into<Orientation>>(self, v: T) -> Self
Sets the value of orientation.
Trait Implementations§
impl StructuralPartialEq for Layout
Auto Trait Implementations§
impl Freeze for Layout
impl RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl UnwindSafe for Layout
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
Mutably borrows from an owned value. Read more