FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ServiceCollection

    struct · ferroui-dependency-injection · v0.5.0

    struct ServiceCollection
    

    Ordered registrations; building a provider snapshots this collection.

    View source

    Members

    new

    fn new() -> Self
    

    Source

    descriptors

    fn descriptors(self: &Self) -> &[ServiceDescriptor]
    

    Source

    len

    fn len(self: &Self) -> usize
    

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    is_read_only

    fn is_read_only(self: &Self) -> bool
    

    Source

    make_read_only

    fn make_read_only(self: &mut Self)
    

    Source

    add

    fn add(self: &mut Self, descriptor: ServiceDescriptor) -> &mut Self
    

    Source

    add_sequence

    fn add_sequence(self: &mut Self, descriptors: impl IntoIterator<Item = ServiceDescriptor>) -> &mut Self
    

    Source

    insert

    fn insert(self: &mut Self, index: usize, descriptor: ServiceDescriptor)
    

    Source

    remove_at

    fn remove_at(self: &mut Self, index: usize) -> ServiceDescriptor
    

    Source

    clear

    fn clear(self: &mut Self)
    

    Source

    try_add

    fn try_add(self: &mut Self, descriptor: ServiceDescriptor) -> &mut Self
    

    Source

    try_add_enumerable

    fn try_add_enumerable(self: &mut Self, descriptor: ServiceDescriptor) -> &mut Self
    

    Source

    replace

    fn replace(self: &mut Self, descriptor: ServiceDescriptor) -> &mut Self
    

    Removes the first matching registration, then appends the replacement, as upstream.

    Source

    remove_all

    fn remove_all<S: ?Sized + 'static>(self: &mut Self) -> &mut Self
    

    Source

    remove_all_keyed

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

    Source

    iter

    fn iter(self: &Self) -> std::slice::Iter<'_, ServiceDescriptor>
    

    Source

    contains

    fn contains(self: &Self, descriptor: &ServiceDescriptor) -> bool
    

    Source

    index_of

    fn index_of(self: &Self, descriptor: &ServiceDescriptor) -> Option<usize>
    

    Source

    remove

    fn remove(self: &mut Self, descriptor: &ServiceDescriptor) -> bool
    

    Source

    copy_to

    fn copy_to(self: &Self, target: &mut [ServiceDescriptor], index: usize)
    

    Source

    build_service_provider

    fn build_service_provider(self: &Self, options: ServiceProviderOptions) -> ServiceResult<ServiceProvider>
    

    Source

    add_singleton_instance

    fn add_singleton_instance<S: ?Sized + 'static>(self: &mut Self, value: Rc<S>) -> &mut Self
    

    Source

    add_keyed_singleton_instance

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

    Source

    add_singleton

    fn add_singleton<S: ?Sized + 'static, F>(self: &mut Self, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider) -> ServiceResult<Rc<S>> + 'static
    

    Source

    add_keyed_singleton

    fn add_keyed_singleton<S: ?Sized + 'static, F>(self: &mut Self, key: Option<ServiceKey>, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider, Option<&ServiceKey>) -> ServiceResult<Rc<S>> + 'static
    

    Source

    add_scoped

    fn add_scoped<S: ?Sized + 'static, F>(self: &mut Self, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider) -> ServiceResult<Rc<S>> + 'static
    

    Source

    add_keyed_scoped

    fn add_keyed_scoped<S: ?Sized + 'static, F>(self: &mut Self, key: Option<ServiceKey>, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider, Option<&ServiceKey>) -> ServiceResult<Rc<S>> + 'static
    

    Source

    add_transient

    fn add_transient<S: ?Sized + 'static, F>(self: &mut Self, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider) -> ServiceResult<Rc<S>> + 'static
    

    Source

    add_keyed_transient

    fn add_keyed_transient<S: ?Sized + 'static, F>(self: &mut Self, key: Option<ServiceKey>, factory: F) -> &mut Self
    where F: Fn(&ServiceProvider, Option<&ServiceKey>) -> ServiceResult<Rc<S>> + 'static
    

    Source

    Trait implementations

    Availability

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