Skip to main content

Translatable

Trait Translatable 

Source
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§

Source

fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))

Visit every translatable string field in a stable order.

Source

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>

Source§

fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))

Source§

fn after_translate(&mut self)

Source§

impl<T: Translatable> Translatable for Vec<T>

Source§

fn visit_translatable(&mut self, visit: &mut dyn FnMut(&mut String))

Source§

fn after_translate(&mut self)

Implementors§

Source§

impl Translatable for AssetProfile

Source§

impl Translatable for BatchCapitalGainsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchChartsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchDividendsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchFinancialsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchIndicatorsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchNewsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchOptionsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchQuotesResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchRecommendationsResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchSparksResponse

Available on crate feature translation only.
Source§

impl Translatable for BatchSplitsResponse

Available on crate feature translation only.
Source§

impl Translatable for CalendarEvents

Source§

impl Translatable for CapitalGain

Source§

impl Translatable for Chart

Source§

impl Translatable for CompanyOfficer

Source§

impl Translatable for DefaultKeyStatistics

Source§

impl Translatable for Dividend

Source§

impl Translatable for Earnings

Source§

impl Translatable for EarningsHistory

Source§

impl Translatable for EarningsTrend

Source§

impl Translatable for EquityPerformance

Source§

impl Translatable for FinancialData

Source§

impl Translatable for FinancialStatement

Source§

impl Translatable for FundOwnership

Source§

impl Translatable for FundPerformance

Source§

impl Translatable for FundProfile

Source§

impl Translatable for IndexTrend

Source§

impl Translatable for IndicatorsSummary

Source§

impl Translatable for IndustryData

Source§

impl Translatable for IndustryTrend

Source§

impl Translatable for InsiderHolders

Source§

impl Translatable for InsiderTransactions

Source§

impl Translatable for InstitutionOwnership

Source§

impl Translatable for LookupQuote

Source§

impl Translatable for LookupResults

Source§

impl Translatable for MajorHoldersBreakdown

Source§

impl Translatable for MarketSummaryQuote

Source§

impl Translatable for NetSharePurchaseActivity

Source§

impl Translatable for News

Source§

impl Translatable for Options

Source§

impl Translatable for QuoteTypeData

Source§

impl Translatable for Recommendation

Source§

impl Translatable for RecommendationTrend

Source§

impl Translatable for SearchNews

Source§

impl Translatable for SearchNewsList

Source§

impl Translatable for SearchQuote

Source§

impl Translatable for SearchQuotes

Source§

impl Translatable for SearchResults

Source§

impl Translatable for SecFilings

Source§

impl Translatable for SectorData

Source§

impl Translatable for SectorTrend

Source§

impl Translatable for Spark

Source§

impl Translatable for Split

Source§

impl Translatable for SummaryDetail

Source§

impl Translatable for SummaryProfile

Source§

impl Translatable for TopHoldings

Source§

impl Translatable for Transcript

Source§

impl Translatable for TranscriptWithMeta

Source§

impl Translatable for UpgradeDowngradeHistory

Source§

impl<F: Format> Translatable for Price<F>

Source§

impl<F: Format> Translatable for Quote<F>