Trait rscontainer::IShared[][src]

pub trait IShared {
    type Pointer: ISharedPointer + IAccess<Target = Self::Target>;
    type Target;
    type Error;
    fn construct(ctn: Resolver<'_>) -> Result<Self::Pointer, Self::Error>;

    fn resolved(_this: &mut Self::Pointer, _ctn: Resolver<'_>) { ... }
}
Expand description

A type that can be used as a shared service.

Associated Types

The type of the smart pointer to the service. Supported by default:

  • Rc<Access<T>>
  • Rc<Cell<T>>
  • Rc<RefCell<T>>
  • Arc<Access<T>>
  • Arc<Mutex<T>>
  • Arc<RwLock<T>>

Where T is equal to Self::Target.

Use the Access wrapper if the type is read-only or already implements interior mutability.

The type that is used to access the shared instance.

This should be the type that the pointer eventually dereferences to.

The type of the error that can occur when constructing or resolving this service.

Required methods

Constructs an instance of the shared service.

Provided methods

Called each time after the service is resolved from the container.

Implementations on Foreign Types

Implementors