pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
Sourcepub fn new() -> Self
pub fn new() -> Self
Generate a new context to be used by cinderblock applications.
§Data layers
This methods adds a data_layer::in_memory::InMemoryDataLayer by default.
Sourcepub fn register_data_layer<DL: Debug + Send + Sync + 'static>(
&mut self,
data_layer: DL,
)
pub fn register_data_layer<DL: Debug + Send + Sync + 'static>( &mut self, data_layer: DL, )
Register a data layer instance so resources can look it up at runtime.
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 UnsafeUnpin 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