FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RegistrationHelper

    struct · ferroui-base · v0.5.0

    struct RegistrationHelper<'a, T: ?Sized + 'static>
    

    Binds the service type T to an implementation; see FerroLocator::bind.

    View source

    Members

    to_constant

    fn to_constant(self: Self, constant: Rc<T>) -> &'a FerroLocator
    

    Every lookup returns constant.

    Source

    to_func

    fn to_func(self: Self, func: impl Fn() -> Option<Rc<T>> + 'static) -> &'a FerroLocator
    

    Every lookup calls func.

    Source

    to_lazy

    fn to_lazy(self: Self, func: impl Fn() -> Option<Rc<T>> + 'static) -> &'a FerroLocator
    

    The first lookup calls func; later lookups return what it produced.

    Source

    to_singleton

    fn to_singleton<TImpl: Default + 'static>(self: Self, upcast: fn(Rc<TImpl>) -> Rc<T>) -> &'a FerroLocator
    

    The first lookup creates a TImpl, which every lookup then returns.

    upcast converts the implementation handle to the service handle; for a trait object service it is the identity closure |instance| instance, which performs the unsizing coercion.

    Source

    to_transient

    fn to_transient<TImpl: Default + 'static>(self: Self, upcast: fn(Rc<TImpl>) -> Rc<T>) -> &'a FerroLocator
    

    Every lookup creates a new TImpl. See to_singleton for upcast.

    Source

    Trait implementations

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

    Availability

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