#[non_exhaustive]pub struct TranslationSettingsBuilder { /* private fields */ }Expand description
A builder for TranslationSettings.
Implementations§
source§impl TranslationSettingsBuilder
impl TranslationSettingsBuilder
sourcepub fn formality(self, input: Formality) -> Self
pub fn formality(self, input: Formality) -> Self
You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.
If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.
For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.
sourcepub fn set_formality(self, input: Option<Formality>) -> Self
pub fn set_formality(self, input: Option<Formality>) -> Self
You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.
If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.
For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.
sourcepub fn get_formality(&self) -> &Option<Formality>
pub fn get_formality(&self) -> &Option<Formality>
You can specify the desired level of formality for translations to supported target languages. The formality setting controls the level of formal language usage (also known as register) in the translation output. You can set the value to informal or formal. If you don't specify a value for formality, or if the target language doesn't support formality, the translation will ignore the formality setting.
If you specify multiple target languages for the job, translate ignores the formality setting for any unsupported target language.
For a list of target languages that support formality, see Supported languages in the Amazon Translate Developer Guide.
sourcepub fn profanity(self, input: Profanity) -> Self
pub fn profanity(self, input: Profanity) -> Self
You can enable the profanity setting if you want to mask profane words and phrases in your translation output.
To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.
Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.
If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.
sourcepub fn set_profanity(self, input: Option<Profanity>) -> Self
pub fn set_profanity(self, input: Option<Profanity>) -> Self
You can enable the profanity setting if you want to mask profane words and phrases in your translation output.
To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.
Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.
If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.
sourcepub fn get_profanity(&self) -> &Option<Profanity>
pub fn get_profanity(&self) -> &Option<Profanity>
You can enable the profanity setting if you want to mask profane words and phrases in your translation output.
To mask profane words and phrases, Amazon Translate replaces them with the grawlix string “?$#@$“. This 5-character sequence is used for each profane word or phrase, regardless of the length or number of words.
Amazon Translate doesn't detect profanity in all of its supported languages. For languages that don't support profanity detection, see Unsupported languages in the Amazon Translate Developer Guide.
If you specify multiple target languages for the job, all the target languages must support profanity masking. If any of the target languages don't support profanity masking, the translation job won't mask profanity for any target language.
sourcepub fn brevity(self, input: Brevity) -> Self
pub fn brevity(self, input: Brevity) -> Self
When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.
If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.
For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.
sourcepub fn set_brevity(self, input: Option<Brevity>) -> Self
pub fn set_brevity(self, input: Option<Brevity>) -> Self
When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.
If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.
For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.
sourcepub fn get_brevity(&self) -> &Option<Brevity>
pub fn get_brevity(&self) -> &Option<Brevity>
When you turn on brevity, Amazon Translate reduces the length of the translation output for most translations (when compared with the same translation with brevity turned off). By default, brevity is turned off.
If you turn on brevity for a translation request with an unsupported language pair, the translation proceeds with the brevity setting turned off.
For the language pairs that brevity supports, see Using brevity in the Amazon Translate Developer Guide.
sourcepub fn build(self) -> TranslationSettings
pub fn build(self) -> TranslationSettings
Consumes the builder and constructs a TranslationSettings.
Trait Implementations§
source§impl Clone for TranslationSettingsBuilder
impl Clone for TranslationSettingsBuilder
source§fn clone(&self) -> TranslationSettingsBuilder
fn clone(&self) -> TranslationSettingsBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TranslationSettingsBuilder
impl Debug for TranslationSettingsBuilder
source§impl Default for TranslationSettingsBuilder
impl Default for TranslationSettingsBuilder
source§fn default() -> TranslationSettingsBuilder
fn default() -> TranslationSettingsBuilder
source§impl PartialEq for TranslationSettingsBuilder
impl PartialEq for TranslationSettingsBuilder
source§fn eq(&self, other: &TranslationSettingsBuilder) -> bool
fn eq(&self, other: &TranslationSettingsBuilder) -> bool
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for TranslationSettingsBuilder
Auto Trait Implementations§
impl Freeze for TranslationSettingsBuilder
impl RefUnwindSafe for TranslationSettingsBuilder
impl Send for TranslationSettingsBuilder
impl Sync for TranslationSettingsBuilder
impl Unpin for TranslationSettingsBuilder
impl UnwindSafe for TranslationSettingsBuilder
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
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more