IServiceProvider
trait · ferroui-base · v0.5.0
trait IServiceProvider
Retrieves service objects by the type of their handle.
A service is identified by the Rust type of the handle it is used
through, normally the handle of a contract (Rc<dyn IProvideValueTarget>,
Rc<dyn IRootObjectProvider>, Rc<dyn INameScope>). The provider returns
the handle boxed as Any; the box holds exactly a value of the
requested type.
let target: Option<Rc<dyn IProvideValueTarget>> = service_provider.get_service_of();
Members
get_service
fn get_service(self: &Self, service_type: TypeId) -> Option<Rc<dyn Any>>
Gets the service whose handle type is service_type, or None if
the provider has no such service. The returned box holds a value of
exactly the type identified by service_type.
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.