FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableLocalizedString

    struct · ferroui-protranslate-core · v0.5.0

    struct ObservableLocalizedString
    

    View source

    Members

    key

    fn key(self: &Self) -> &str
    

    Source

    value

    fn value(self: &Self) -> Result<String, TranslationError>
    

    Source

    snapshot

    fn snapshot(self: &Self) -> ObservableLocalizedSnapshot
    

    Source

    localized_string

    fn localized_string(self: &Self) -> Result<LocalizedString, TranslationError>
    

    Source

    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.

    Source

    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.

    Source

    update_arguments

    fn update_arguments(self: &Self, arguments: Vec<FormatArgument>) -> Result<(), TranslationError>
    

    Source

    dispose

    fn dispose(self: &Self)
    

    Disconnect all clones of this observation while retaining its last snapshot. Dropping the final clone also disconnects automatically.

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    refresh

    fn refresh(self: &Self)
    

    Source

    subscribe

    fn subscribe(self: &Self, callback: impl Fn(&Result<String, TranslationError>) -> () + 'static) -> Subscription
    

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.