#[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
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LayoutImageBlock
impl Debug for LayoutImageBlock
Source§impl Default for LayoutImageBlock
impl Default for LayoutImageBlock
Source§fn default() -> LayoutImageBlock
fn default() -> LayoutImageBlock
Source§impl Message for LayoutImageBlock
impl Message for LayoutImageBlock
Source§impl PartialEq for LayoutImageBlock
impl PartialEq for LayoutImageBlock
impl StructuralPartialEq for LayoutImageBlock
Auto Trait Implementations§
impl Freeze for LayoutImageBlock
impl RefUnwindSafe for LayoutImageBlock
impl Send for LayoutImageBlock
impl Sync for LayoutImageBlock
impl Unpin for LayoutImageBlock
impl UnsafeUnpin for LayoutImageBlock
impl UnwindSafe for LayoutImageBlock
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request