#[non_exhaustive]pub struct LayoutImageBlock {
pub mime_type: String,
pub image_text: String,
pub annotations: Option<Annotations>,
pub image_source: Option<ImageSource>,
/* private fields */
}Expand description
Represents an image type block.
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.mime_type: StringMime type of the image. An IANA published [media type (MIME type)] (https://www.iana.org/assignments/media-types/media-types.xhtml).
image_text: StringText extracted from the image using OCR or alt text describing the image.
annotations: Option<Annotations>Annotation of the image block.
image_source: Option<ImageSource>Source of the image.
Implementations§
Source§impl LayoutImageBlock
impl LayoutImageBlock
pub fn new() -> Self
Sourcepub fn set_mime_type<T: Into<String>>(self, v: T) -> Self
pub fn set_mime_type<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_image_text<T: Into<String>>(self, v: T) -> Self
pub fn set_image_text<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_annotations<T>(self, v: T) -> Selfwhere
T: Into<Annotations>,
pub fn set_annotations<T>(self, v: T) -> Selfwhere
T: Into<Annotations>,
Sets the value of annotations.
§Example
use google_cloud_documentai_v1::model::document::Annotations;
let x = LayoutImageBlock::new().set_annotations(Annotations::default()/* use setters */);Sourcepub fn set_or_clear_annotations<T>(self, v: Option<T>) -> Selfwhere
T: Into<Annotations>,
pub fn set_or_clear_annotations<T>(self, v: Option<T>) -> Selfwhere
T: Into<Annotations>,
Sets or clears the value of annotations.
§Example
use google_cloud_documentai_v1::model::document::Annotations;
let x = LayoutImageBlock::new().set_or_clear_annotations(Some(Annotations::default()/* use setters */));
let x = LayoutImageBlock::new().set_or_clear_annotations(None::<Annotations>);Sourcepub fn set_image_source<T: Into<Option<ImageSource>>>(self, v: T) -> Self
pub fn set_image_source<T: Into<Option<ImageSource>>>(self, v: T) -> Self
Sets the value of image_source.
Note that all the setters affecting image_source are mutually
exclusive.
§Example
use google_cloud_documentai_v1::model::document::document_layout::document_layout_block::layout_image_block::ImageSource;
let x = LayoutImageBlock::new().set_image_source(Some(ImageSource::BlobAssetId("example".to_string())));Sourcepub fn blob_asset_id(&self) -> Option<&String>
pub fn blob_asset_id(&self) -> Option<&String>
The value of image_source
if it holds a BlobAssetId, None if the field is not set or
holds a different branch.
Sourcepub fn set_blob_asset_id<T: Into<String>>(self, v: T) -> Self
pub fn set_blob_asset_id<T: Into<String>>(self, v: T) -> Self
Sets the value of image_source
to hold a BlobAssetId.
Note that all the setters affecting image_source are
mutually exclusive.
§Example
let x = LayoutImageBlock::new().set_blob_asset_id("example");
assert!(x.blob_asset_id().is_some());
assert!(x.gcs_uri().is_none());
assert!(x.data_uri().is_none());Sourcepub fn gcs_uri(&self) -> Option<&String>
pub fn gcs_uri(&self) -> Option<&String>
The value of image_source
if it holds a GcsUri, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcs_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_gcs_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of image_source
to hold a GcsUri.
Note that all the setters affecting image_source are
mutually exclusive.
§Example
let x = LayoutImageBlock::new().set_gcs_uri("example");
assert!(x.gcs_uri().is_some());
assert!(x.blob_asset_id().is_none());
assert!(x.data_uri().is_none());Sourcepub fn data_uri(&self) -> Option<&String>
pub fn data_uri(&self) -> Option<&String>
The value of image_source
if it holds a DataUri, None if the field is not set or
holds a different branch.
Sourcepub fn set_data_uri<T: Into<String>>(self, v: T) -> Self
pub fn set_data_uri<T: Into<String>>(self, v: T) -> Self
Sets the value of image_source
to hold a DataUri.
Note that all the setters affecting image_source are
mutually exclusive.
§Example
let x = LayoutImageBlock::new().set_data_uri("example");
assert!(x.data_uri().is_some());
assert!(x.blob_asset_id().is_none());
assert!(x.gcs_uri().is_none());Trait Implementations§
Source§impl Clone for LayoutImageBlock
impl Clone for LayoutImageBlock
Source§fn clone(&self) -> LayoutImageBlock
fn clone(&self) -> LayoutImageBlock
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more