FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObservableLoggingMixins

    trait · ferroui-reactiveui · v0.5.0

    trait ObservableLoggingMixins<T>
    

    The extension methods of ObservableLoggingMixins on an observable.

    Deviation (DEVIATIONS.md, ReactiveUI): the logging object is an Rc (the closures that log keep it); a value is written with its Debug form where upstream calls ToString(); and the overloads are named by what they take (log, log_message, log_with_stringifier; logged_catch, logged_catch_to, logged_catch_of).

    View source

    Members

    log

    fn log<O: IEnableLogger + ?Sized + 'static>(self: &Self, log_object: Rc<O>) -> Rc<dyn IObservable<T>>
    where T: fmt::Debug
    

    Logs every notification at the level Info (OnNext, OnCompleted) or Warn (OnError) through the logger of log_object (Log<TObj>(TObj)).

    Source

    log_message

    fn log_message<O: IEnableLogger + ?Sized + 'static>(self: &Self, log_object: Rc<O>, message: Option<&str>) -> Rc<dyn IObservable<T>>
    where T: fmt::Debug
    

    log with message before each entry (Log<TObj>(TObj, string?)).

    Source

    log_with_stringifier

    fn log_with_stringifier<O: IEnableLogger + ?Sized + 'static>(self: &Self, log_object: Rc<O>, message: Option<&str>, stringifier: impl Fn(&T) -> String + 'static) -> Rc<dyn IObservable<T>>
    

    log_message that writes each value with stringifier (Log<TObj>(TObj, string?, Func<T, string>?)).

    Source

    logged_catch

    fn logged_catch<O: IEnableLogger + ?Sized + 'static>(self: &Self, class: Rc<O>, next: Option<Rc<dyn IObservable<T>>>, message: Option<&str>) -> Rc<dyn IObservable<T>>
    where T: Default + Clone
    

    Continues with next (a sequence of the default value when None) when the source fails, after a Warn entry with message in the logger of class (LoggedCatch<TObj>(TObj), LoggedCatch<TObj>(TObj, IObservable<T>?), LoggedCatch<TObj>(TObj, IObservable<T>?, string?)).

    Source

    logged_catch_to

    fn logged_catch_to<O: IEnableLogger + ?Sized + 'static>(self: &Self, class: Rc<O>, next: Rc<dyn IObservable<T>>, message: Option<&str>) -> Rc<dyn IObservable<T>>
    

    logged_catch with the sequence to continue with, which needs no default value.

    Source

    logged_catch_of

    fn logged_catch_of<O: IEnableLogger + ?Sized + 'static, E: Error + 'static>(self: &Self, class: Rc<O>, next: impl Fn(ObservableError) -> Rc<dyn IObservable<T>> + 'static, message: Option<&str>) -> Rc<dyn IObservable<T>>
    

    Continues with the sequence next gives for the error when the source fails with an error of the type E, after a Warn entry; other errors pass through (LoggedCatch<TObj, TException>(TObj, Func<TException, IObservable<T>>, string?)). next receives the error, which downcast_ref::<E> reads.

    Source

    Trait implementations

    Availability

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