FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ServiceProvider

    struct · ferroui-dependency-injection · v0.5.0

    struct ServiceProvider
    

    Cloneable handle to a root provider or a scope. Neither Send nor Sync: services stay on the creating thread. Cloning shares state; it never creates a new scope.

    View source

    Members

    same_as

    fn same_as(self: &Self, other: &ServiceProvider) -> bool
    

    Whether both handles are the same provider or scope.

    Source

    is_disposed

    fn is_disposed(self: &Self) -> bool
    

    Source

    create_scope

    fn create_scope(self: &Self) -> ServiceResult<ServiceScope>
    

    Source

    create_async_scope

    fn create_async_scope(self: &Self) -> ServiceResult<AsyncServiceScope>
    

    Source

    get_service

    fn get_service<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Option<Rc<S>>>
    

    Source

    get_required_service

    fn get_required_service<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Rc<S>>
    

    Source

    get_services

    fn get_services<S: ?Sized + 'static>(self: &Self) -> ServiceResult<Vec<Rc<S>>>
    

    Source

    get_keyed_service

    fn get_keyed_service<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Option<Rc<S>>>
    

    Source

    get_required_keyed_service

    fn get_required_keyed_service<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Rc<S>>
    

    Source

    get_keyed_services

    fn get_keyed_services<S: ?Sized + 'static>(self: &Self, key: Option<&ServiceKey>) -> ServiceResult<Vec<Rc<S>>>
    

    Source

    dispose

    fn dispose(self: &Self) -> ServiceResult<()>
    

    Disposes captured services in reverse construction order. Async-only services require dispose_async; that error leaves the scope active so the caller can retry asynchronously.

    Source

    dispose_async

    fn dispose_async(self: &Self) -> DisposeTask
    

    Source

    Trait implementations

    Availability

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