pub struct Context { /* private fields */ }
Implementations§
Source§impl Context
impl Context
pub fn new(name: &str) -> Context
pub fn name(&self) -> &str
pub fn add_context(&self, context: Context)
pub fn add_init_fn( &self, name: &str, init_fn: Arc<dyn Fn(&Context) -> Result<(), Error> + Send + Sync>, ) -> Result<(), Error>
pub fn init_contexts(&self) -> Result<(), Error>
pub fn register(&self, bean_def: impl Into<BeanDef>) -> Result<(), Error>
pub fn get_bean<T: ?Sized + 'static>(&self, name: &str) -> Result<Arc<T>, Error>
pub fn get_primary_bean<T: ?Sized + 'static>(&self) -> Result<Arc<T>, Error>
pub fn get_beans<T: ?Sized + 'static>(&self) -> Result<Vec<Arc<T>>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl !UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more