#[non_exhaustive]pub struct Entity {
pub text_anchor: Option<TextAnchor>,
pub type: String,
pub mention_text: String,
pub mention_id: String,
pub confidence: f32,
pub page_anchor: Option<PageAnchor>,
pub id: String,
pub normalized_value: Option<NormalizedValue>,
pub properties: Vec<Entity>,
pub provenance: Option<Provenance>,
pub redacted: bool,
pub method: Method,
/* private fields */
}Expand description
An entity that could be a phrase in the text or a property that belongs to the document. It is a known entity type, such as a person, an organization, or location.
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.text_anchor: Option<TextAnchor>Optional. Provenance of the entity. Text anchor indexing into the Document.text.
type: StringRequired. Entity type from a schema e.g. Address.
mention_text: StringOptional. Text value of the entity e.g. 1600 Amphitheatre Pkwy.
mention_id: StringOptional. Deprecated. Use id field instead.
confidence: f32Optional. Confidence of detected Schema entity. Range [0, 1].
page_anchor: Option<PageAnchor>Optional. Represents the provenance of this entity wrt. the location on the page where it was found.
id: StringOptional. Canonical id. This will be a unique value in the entity list for this document.
normalized_value: Option<NormalizedValue>Optional. Normalized entity value. Absent if the extracted value could not be converted or the type (e.g. address) is not supported for certain parsers. This field is also only populated for certain supported document types.
properties: Vec<Entity>Optional. Entities can be nested to form a hierarchical data structure representing the content in the document.
provenance: Option<Provenance>Optional. The history of this annotation.
redacted: boolOptional. Whether the entity will be redacted for de-identification purposes.
method: MethodOptional. Specifies how the entity’s value is obtained.
Implementations§
Source§impl Entity
impl Entity
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.
§Example
use google_cloud_documentai_v1::model::document::TextAnchor;
let x = Entity::new().set_text_anchor(TextAnchor::default()/* use setters */);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.
§Example
use google_cloud_documentai_v1::model::document::TextAnchor;
let x = Entity::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
let x = Entity::new().set_or_clear_text_anchor(None::<TextAnchor>);Sourcepub fn set_mention_text<T: Into<String>>(self, v: T) -> Self
pub fn set_mention_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_mention_id<T: Into<String>>(self, v: T) -> Self
pub fn set_mention_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
pub fn set_confidence<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_page_anchor<T>(self, v: T) -> Selfwhere
T: Into<PageAnchor>,
pub fn set_page_anchor<T>(self, v: T) -> Selfwhere
T: Into<PageAnchor>,
Sets the value of page_anchor.
§Example
use google_cloud_documentai_v1::model::document::PageAnchor;
let x = Entity::new().set_page_anchor(PageAnchor::default()/* use setters */);Sourcepub fn set_or_clear_page_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<PageAnchor>,
pub fn set_or_clear_page_anchor<T>(self, v: Option<T>) -> Selfwhere
T: Into<PageAnchor>,
Sets or clears the value of page_anchor.
§Example
use google_cloud_documentai_v1::model::document::PageAnchor;
let x = Entity::new().set_or_clear_page_anchor(Some(PageAnchor::default()/* use setters */));
let x = Entity::new().set_or_clear_page_anchor(None::<PageAnchor>);Sourcepub fn set_normalized_value<T>(self, v: T) -> Selfwhere
T: Into<NormalizedValue>,
pub fn set_normalized_value<T>(self, v: T) -> Selfwhere
T: Into<NormalizedValue>,
Sets the value of normalized_value.
§Example
use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
let x = Entity::new().set_normalized_value(NormalizedValue::default()/* use setters */);Sourcepub fn set_or_clear_normalized_value<T>(self, v: Option<T>) -> Selfwhere
T: Into<NormalizedValue>,
pub fn set_or_clear_normalized_value<T>(self, v: Option<T>) -> Selfwhere
T: Into<NormalizedValue>,
Sets or clears the value of normalized_value.
§Example
use google_cloud_documentai_v1::model::document::entity::NormalizedValue;
let x = Entity::new().set_or_clear_normalized_value(Some(NormalizedValue::default()/* use setters */));
let x = Entity::new().set_or_clear_normalized_value(None::<NormalizedValue>);Sourcepub fn set_properties<T, V>(self, v: T) -> Self
pub fn set_properties<T, V>(self, v: T) -> Self
Sets the value of properties.
§Example
let x = Entity::new()
.set_properties([
Entity::default()/* use setters */,
Entity::default()/* use (different) setters */,
]);Sourcepub fn set_provenance<T>(self, v: T) -> Selfwhere
T: Into<Provenance>,
pub fn set_provenance<T>(self, v: T) -> Selfwhere
T: Into<Provenance>,
Sets the value of provenance.
§Example
use google_cloud_documentai_v1::model::document::Provenance;
let x = Entity::new().set_provenance(Provenance::default()/* use setters */);Sourcepub fn set_or_clear_provenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<Provenance>,
pub fn set_or_clear_provenance<T>(self, v: Option<T>) -> Selfwhere
T: Into<Provenance>,
Sets or clears the value of provenance.
§Example
use google_cloud_documentai_v1::model::document::Provenance;
let x = Entity::new().set_or_clear_provenance(Some(Provenance::default()/* use setters */));
let x = Entity::new().set_or_clear_provenance(None::<Provenance>);