Docs.rs
  • springtime-di-0.2.0
    • springtime-di 0.2.0
    • Docs.rs crate page
    • MIT
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • krojew
    • Dependencies
      • derivative ^2.2.0 normal
      • futures ^0.3.28 normal
      • fxhash ^0.2.1 normal
      • inventory ^0.3.4 normal
      • itertools ^0.10.5 normal
      • springtime-di-derive ^0.2 normal
      • thiserror ^1.0.39 normal
      • tokio ^1.27.0 normal
      • mockall ^0.11.4 dev
    • Versions
    • 59.83% of the crate is documented
  • Go to latest version
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
logo

logo

ComponentInstanceProvider

Required Methods

  • instance_by_name
  • instances
  • primary_instance

Implementors

In springtime_di::instance_provider

?
Change settings

Trait springtime_di::instance_provider::ComponentInstanceProvider

source ·
pub trait ComponentInstanceProvider {
    // Required methods
    fn primary_instance(
        &mut self,
        type_id: TypeId
    ) -> Result<(ComponentInstanceAnyPtr, CastFunction), ComponentInstanceProviderError>;
    fn instances(
        &mut self,
        type_id: TypeId
    ) -> Result<Vec<(ComponentInstanceAnyPtr, CastFunction)>, ComponentInstanceProviderError>;
    fn instance_by_name(
        &mut self,
        name: &str,
        type_id: TypeId
    ) -> Result<(ComponentInstanceAnyPtr, CastFunction), ComponentInstanceProviderError>;
}
Expand description

Generic provider for component instances.

Required Methods§

source

fn primary_instance( &mut self, type_id: TypeId ) -> Result<(ComponentInstanceAnyPtr, CastFunction), ComponentInstanceProviderError>

source

fn instances( &mut self, type_id: TypeId ) -> Result<Vec<(ComponentInstanceAnyPtr, CastFunction)>, ComponentInstanceProviderError>

source

fn instance_by_name( &mut self, name: &str, type_id: TypeId ) -> Result<(ComponentInstanceAnyPtr, CastFunction), ComponentInstanceProviderError>

Implementors§

source§

impl ComponentInstanceProvider for ComponentFactory