pub struct TranslationPlan { /* private fields */ }Expand description
A deterministic direct or Pivot Translation plan.
Implementations§
Source§impl TranslationPlan
impl TranslationPlan
Sourcepub fn new(
source: CuratedLanguage,
target: CuratedLanguage,
) -> Result<Self, TranslationPlanError>
pub fn new( source: CuratedLanguage, target: CuratedLanguage, ) -> Result<Self, TranslationPlanError>
Selects the stable validated plan for a pair of curated languages.
Sourcepub fn from_language_codes(
source: &str,
target: &str,
) -> Result<Self, TranslationPlanError>
pub fn from_language_codes( source: &str, target: &str, ) -> Result<Self, TranslationPlanError>
Parses ISO 639-1 codes and selects their stable validated plan.
Sourcepub const fn source(&self) -> CuratedLanguage
pub const fn source(&self) -> CuratedLanguage
Returns the requested source language.
Sourcepub const fn target(&self) -> CuratedLanguage
pub const fn target(&self) -> CuratedLanguage
Returns the requested target language.
Sourcepub const fn provenance(&self) -> TranslationPlanProvenance
pub const fn provenance(&self) -> TranslationPlanProvenance
Returns whether the plan is direct or a Pivot Translation.
Sourcepub fn legs(&self) -> &[TranslationLeg]
pub fn legs(&self) -> &[TranslationLeg]
Returns the one or two model legs in execution order.
Trait Implementations§
Source§impl Clone for TranslationPlan
impl Clone for TranslationPlan
Source§fn clone(&self) -> TranslationPlan
fn clone(&self) -> TranslationPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TranslationPlan
impl Debug for TranslationPlan
impl Eq for TranslationPlan
Source§impl PartialEq for TranslationPlan
impl PartialEq for TranslationPlan
Source§impl Serialize for TranslationPlan
impl Serialize for TranslationPlan
impl StructuralPartialEq for TranslationPlan
Auto Trait Implementations§
impl Freeze for TranslationPlan
impl RefUnwindSafe for TranslationPlan
impl Send for TranslationPlan
impl Sync for TranslationPlan
impl Unpin for TranslationPlan
impl UnsafeUnpin for TranslationPlan
impl UnwindSafe for TranslationPlan
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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>
Converts
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>
Converts
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