Struct aws_sdk_translate::client::fluent_builders::TranslateText
source · [−]pub struct TranslateText { /* private fields */ }Expand description
Fluent builder constructing a request to TranslateText.
Translates input text from the source language to the target language. For a list of available languages and language codes, see what-is-languages.
Implementations
sourceimpl TranslateText
impl TranslateText
sourcepub async fn send(
self
) -> Result<TranslateTextOutput, SdkError<TranslateTextError>>
pub async fn send(
self
) -> Result<TranslateTextOutput, SdkError<TranslateTextError>>
Sends the request and returns the response.
If an error occurs, an SdkError will be returned with additional details that
can be matched against.
By default, any retryable failures will be retried twice. Retry behavior is configurable with the RetryConfig, which can be set when configuring the client.
sourcepub fn text(self, input: impl Into<String>) -> Self
pub fn text(self, input: impl Into<String>) -> Self
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
sourcepub fn set_text(self, input: Option<String>) -> Self
pub fn set_text(self, input: Option<String>) -> Self
The text to translate. The text string can be a maximum of 5,000 bytes long. Depending on your character set, this may be fewer than 5,000 characters.
sourcepub fn terminology_names(self, input: impl Into<String>) -> Self
pub fn terminology_names(self, input: impl Into<String>) -> Self
Appends an item to TerminologyNames.
To override the contents of this collection use set_terminology_names.
The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at most in a TranslateText request. Terminology lists can contain a maximum of 256 terms.
sourcepub fn set_terminology_names(self, input: Option<Vec<String>>) -> Self
pub fn set_terminology_names(self, input: Option<Vec<String>>) -> Self
The name of the terminology list file to be used in the TranslateText request. You can use 1 terminology list at most in a TranslateText request. Terminology lists can contain a maximum of 256 terms.
sourcepub fn source_language_code(self, input: impl Into<String>) -> Self
pub fn source_language_code(self, input: impl Into<String>) -> Self
The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see what-is-languages.
To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language.
sourcepub fn set_source_language_code(self, input: Option<String>) -> Self
pub fn set_source_language_code(self, input: Option<String>) -> Self
The language code for the language of the source text. The language must be a language supported by Amazon Translate. For a list of language codes, see what-is-languages.
To have Amazon Translate determine the source language of your text, you can specify auto in the SourceLanguageCode field. If you specify auto, Amazon Translate will call Amazon Comprehend to determine the source language.
sourcepub fn target_language_code(self, input: impl Into<String>) -> Self
pub fn target_language_code(self, input: impl Into<String>) -> Self
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
sourcepub fn set_target_language_code(self, input: Option<String>) -> Self
pub fn set_target_language_code(self, input: Option<String>) -> Self
The language code requested for the language of the target text. The language must be a language supported by Amazon Translate.
sourcepub fn settings(self, input: TranslationSettings) -> Self
pub fn settings(self, input: TranslationSettings) -> Self
Settings to configure your translation output, including the option to mask profane words and phrases.
sourcepub fn set_settings(self, input: Option<TranslationSettings>) -> Self
pub fn set_settings(self, input: Option<TranslationSettings>) -> Self
Settings to configure your translation output, including the option to mask profane words and phrases.
Trait Implementations
sourceimpl Clone for TranslateText
impl Clone for TranslateText
sourcefn clone(&self) -> TranslateText
fn clone(&self) -> TranslateText
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl !RefUnwindSafe for TranslateText
impl Send for TranslateText
impl Sync for TranslateText
impl Unpin for TranslateText
impl !UnwindSafe for TranslateText
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more