#[non_exhaustive]pub struct TextChange {
pub text_anchor: Option<TextAnchor>,
pub changed_text: String,
pub provenance: Vec<Provenance>,
/* private fields */
}Expand description
This message is used for text changes aka. OCR corrections.
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>Provenance of the correction.
Text anchor indexing into the
Document.text. There can
only be a single TextAnchor.text_segments element. If the start and
end index of the text segment are the same, the text change is inserted
before that index.
changed_text: StringThe text that replaces the text identified in the text_anchor.
provenance: Vec<Provenance>👎Deprecated
The history of this annotation.
Implementations§
Source§impl TextChange
impl TextChange
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 = TextChange::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 = TextChange::new().set_or_clear_text_anchor(Some(TextAnchor::default()/* use setters */));
let x = TextChange::new().set_or_clear_text_anchor(None::<TextAnchor>);Sourcepub fn set_changed_text<T: Into<String>>(self, v: T) -> Self
pub fn set_changed_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_provenance<T, V>(self, v: T) -> Self
👎Deprecated
pub fn set_provenance<T, V>(self, v: T) -> Self
Sets the value of provenance.
§Example
ⓘ
use google_cloud_documentai_v1::model::document::Provenance;
let x = TextChange::new()
.set_provenance([
Provenance::default()/* use setters */,
Provenance::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for TextChange
impl Clone for TextChange
Source§fn clone(&self) -> TextChange
fn clone(&self) -> TextChange
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextChange
impl Debug for TextChange
Source§impl Default for TextChange
impl Default for TextChange
Source§fn default() -> TextChange
fn default() -> TextChange
Returns the “default value” for a type. Read more
Source§impl PartialEq for TextChange
impl PartialEq for TextChange
impl StructuralPartialEq for TextChange
Auto Trait Implementations§
impl Freeze for TextChange
impl RefUnwindSafe for TextChange
impl Send for TextChange
impl Sync for TextChange
impl Unpin for TextChange
impl UnwindSafe for TextChange
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