ObservableLocalizedString
struct · ferroui-protranslate-core · v0.5.0
struct ObservableLocalizedString
Members
keyvaluesnapshotlocalized_stringcultureset_argumentsupdate_argumentsdisposeis_disposedrefreshsubscribesubscribe_snapshot
key
fn key(self: &Self) -> &str
value
fn value(self: &Self) -> Result<String, TranslationError>
snapshot
fn snapshot(self: &Self) -> ObservableLocalizedSnapshot
localized_string
fn localized_string(self: &Self) -> Result<LocalizedString, TranslationError>
culture
fn culture(self: &Self) -> Result<Culture, TranslationError>
The culture that supplied the resolved resource, which can be a parent or fallback culture rather than the currently requested UI culture.
set_arguments
fn set_arguments(self: &Self, arguments: Vec<FormatArgument>)
Update arguments, preserving the source proxy's notification semantics even when the formatted text remains equal.
Panics
Panics after disposal. update_arguments exposes a recoverable error.
update_arguments
fn update_arguments(self: &Self, arguments: Vec<FormatArgument>) -> Result<(), TranslationError>
dispose
fn dispose(self: &Self)
Disconnect all clones of this observation while retaining its last snapshot. Dropping the final clone also disconnects automatically.
is_disposed
fn is_disposed(self: &Self) -> bool
refresh
fn refresh(self: &Self)
subscribe
fn subscribe(self: &Self, callback: impl Fn(&Result<String, TranslationError>) -> () + 'static) -> Subscription
subscribe_snapshot
fn subscribe_snapshot(self: &Self, callback: impl Fn(&ObservableLocalizedSnapshot) -> () + 'static) -> Subscription
Observe metadata and value together. Refreshes notify even if only the resolved culture, provider, diagnostics, or formatting culture changed.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherClone
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.