pub trait Translatable {
// Provided methods
fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String)) { ... }
fn after_translate(&mut self) { ... }
}Expand description
A response type whose human-readable text fields can be translated.
The default implementation visits nothing, so types without natural-language content implement this trait as a no-op marker.
visit_translatable must visit the same fields in the same order on
every call for an unmodified value: the translation pipeline performs one
pass to collect texts and a second pass to write translations back.
Provided Methods§
Sourcefn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))
fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))
Visit every translatable string field in a stable order.
Sourcefn after_translate(&mut self)
fn after_translate(&mut self)
Hook invoked after translations have been written back, for types that maintain derived text (e.g. a transcript’s joined full text).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T: Translatable> Translatable for Option<T>
impl<T: Translatable> Translatable for Option<T>
fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))
fn after_translate(&mut self)
Source§impl<T: Translatable> Translatable for Vec<T>
impl<T: Translatable> Translatable for Vec<T>
fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))
fn after_translate(&mut self)
Implementors§
impl Translatable for BatchCapitalGainsResponse
Available on crate feature
translation only.impl Translatable for BatchChartsResponse
Available on crate feature
translation only.impl Translatable for BatchDividendsResponse
Available on crate feature
translation only.impl Translatable for BatchFinancialsResponse
Available on crate feature
translation only.impl Translatable for BatchIndicatorsResponse
Available on crate feature
translation only.impl Translatable for BatchNewsResponse
Available on crate feature
translation only.impl Translatable for BatchOptionsResponse
Available on crate feature
translation only.impl Translatable for BatchQuotesResponse
Available on crate feature
translation only.impl Translatable for BatchRecommendationsResponse
Available on crate feature
translation only.impl Translatable for BatchSparksResponse
Available on crate feature
translation only.impl Translatable for BatchSplitsResponse
Available on crate feature
translation only.