#[non_exhaustive]pub struct DocumentTranslation {
pub byte_stream_outputs: Vec<Bytes>,
pub mime_type: String,
pub detected_language_code: String,
/* private fields */
}Expand description
A translated document message.
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.byte_stream_outputs: Vec<Bytes>The array of translated documents. It is expected to be size 1 for now. We may produce multiple translated documents in the future for other type of file formats.
mime_type: StringThe translated document’s mime type.
detected_language_code: StringThe detected language for the input document. If the user did not provide the source language for the input document, this field will have the language code automatically detected. If the source language was passed, auto-detection of the language does not occur and this field is empty.
Implementations§
Source§impl DocumentTranslation
impl DocumentTranslation
pub fn new() -> Self
Sourcepub fn set_byte_stream_outputs<T, V>(self, v: T) -> Self
pub fn set_byte_stream_outputs<T, V>(self, v: T) -> Self
Sets the value of byte_stream_outputs.
§Example
ⓘ
let b1 = bytes::Bytes::from_static(b"abc");
let b2 = bytes::Bytes::from_static(b"xyz");
let x = DocumentTranslation::new().set_byte_stream_outputs([b1, b2]);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_detected_language_code<T: Into<String>>(self, v: T) -> Self
pub fn set_detected_language_code<T: Into<String>>(self, v: T) -> Self
Sets the value of detected_language_code.
§Example
ⓘ
let x = DocumentTranslation::new().set_detected_language_code("example");Trait Implementations§
Source§impl Clone for DocumentTranslation
impl Clone for DocumentTranslation
Source§fn clone(&self) -> DocumentTranslation
fn clone(&self) -> DocumentTranslation
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 DocumentTranslation
impl Debug for DocumentTranslation
Source§impl Default for DocumentTranslation
impl Default for DocumentTranslation
Source§fn default() -> DocumentTranslation
fn default() -> DocumentTranslation
Returns the “default value” for a type. Read more
Source§impl Message for DocumentTranslation
impl Message for DocumentTranslation
Source§impl PartialEq for DocumentTranslation
impl PartialEq for DocumentTranslation
impl StructuralPartialEq for DocumentTranslation
Auto Trait Implementations§
impl Freeze for DocumentTranslation
impl RefUnwindSafe for DocumentTranslation
impl Send for DocumentTranslation
impl Sync for DocumentTranslation
impl Unpin for DocumentTranslation
impl UnsafeUnpin for DocumentTranslation
impl UnwindSafe for DocumentTranslation
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