#[non_exhaustive]pub struct DocumentInputConfig {
pub mime_type: String,
pub source: Option<Source>,
/* private fields */
}Expand description
A document translation request input config.
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.mime_type: StringSpecifies the input document’s mime_type.
If not specified it will be determined using the file extension for gcs_source provided files. For a file provided through bytes content the mime_type must be provided. Currently supported mime types are:
- application/pdf
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
source: Option<Source>Specifies the source for the document’s content. The input file size should be <= 20MB for
- application/vnd.openxmlformats-officedocument.wordprocessingml.document
- application/vnd.openxmlformats-officedocument.presentationml.presentation
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet The input file size should be <= 20MB and the maximum page limit is 20 for
- application/pdf
Implementations§
Source§impl DocumentInputConfig
impl DocumentInputConfig
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_source<T: Into<Option<Source>>>(self, v: T) -> Self
pub fn set_source<T: Into<Option<Source>>>(self, v: T) -> Self
Sourcepub fn content(&self) -> Option<&Bytes>
pub fn content(&self) -> Option<&Bytes>
The value of source
if it holds a Content, None if the field is not set or
holds a different branch.
Sourcepub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
pub fn set_content<T: Into<Bytes>>(self, v: T) -> Self
Sourcepub fn gcs_source(&self) -> Option<&Box<GcsSource>>
pub fn gcs_source(&self) -> Option<&Box<GcsSource>>
The value of source
if it holds a GcsSource, None if the field is not set or
holds a different branch.
Sourcepub fn set_gcs_source<T: Into<Box<GcsSource>>>(self, v: T) -> Self
pub fn set_gcs_source<T: Into<Box<GcsSource>>>(self, v: T) -> Self
Sets the value of source
to hold a GcsSource.
Note that all the setters affecting source are
mutually exclusive.
§Example
ⓘ
use google_cloud_translation_v3::model::GcsSource;
let x = DocumentInputConfig::new().set_gcs_source(GcsSource::default()/* use setters */);
assert!(x.gcs_source().is_some());
assert!(x.content().is_none());Trait Implementations§
Source§impl Clone for DocumentInputConfig
impl Clone for DocumentInputConfig
Source§fn clone(&self) -> DocumentInputConfig
fn clone(&self) -> DocumentInputConfig
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 DocumentInputConfig
impl Debug for DocumentInputConfig
Source§impl Default for DocumentInputConfig
impl Default for DocumentInputConfig
Source§fn default() -> DocumentInputConfig
fn default() -> DocumentInputConfig
Returns the “default value” for a type. Read more
Source§impl Message for DocumentInputConfig
impl Message for DocumentInputConfig
Source§impl PartialEq for DocumentInputConfig
impl PartialEq for DocumentInputConfig
impl StructuralPartialEq for DocumentInputConfig
Auto Trait Implementations§
impl !Freeze for DocumentInputConfig
impl RefUnwindSafe for DocumentInputConfig
impl Send for DocumentInputConfig
impl Sync for DocumentInputConfig
impl Unpin for DocumentInputConfig
impl UnsafeUnpin for DocumentInputConfig
impl UnwindSafe for DocumentInputConfig
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