pub struct VibeEngineContext { /* private fields */ }Expand description
Low-level context shared by engine services. Low-level context shared by engine services.
Most applications should use crate::VibeEngine instead. This type is
exposed for advanced integrations that need direct access to the database
or logging clients initialized by the engine.
Implementations§
Source§impl VibeEngineContext
impl VibeEngineContext
Sourcepub fn new(config: VibeEngineConfig) -> Result<Self, VibeEngineError>
pub fn new(config: VibeEngineConfig) -> Result<Self, VibeEngineError>
Creates a context from validated engine configuration.
§Returns
Ok(VibeEngineContext) when log and work stores open successfully, or
VibeEngineError when initialization fails.
§Examples
use vibe_ready::{VibeEngineConfig, VibeEngineContext, VibeResult};
let context = VibeEngineContext::new(VibeEngineConfig::builder().build())?;
futures::executor::block_on(context.close())?;Source§impl VibeEngineContext
impl VibeEngineContext
Sourcepub fn log_db_client(&self) -> &Arc<VibeLogger> ⓘ
pub fn log_db_client(&self) -> &Arc<VibeLogger> ⓘ
Returns the initialized log client.
§Returns
A shared reference to the internal logger used by crate::VibeEngine.
Sourcepub fn db_client(&self) -> &VibeDbClient
pub fn db_client(&self) -> &VibeDbClient
Returns the initialized work-store database client.
§Returns
A reference to the crate::VibeDbClient used by high-level storage APIs.
Sourcepub fn engine_config(&self) -> &VibeEngineConfig
pub fn engine_config(&self) -> &VibeEngineConfig
Returns the validated engine configuration used to create this context.
§Returns
A reference to the immutable VibeEngineConfig stored by the context.
Sourcepub async fn close(&self) -> Result<(), VibeEngineError>
pub async fn close(&self) -> Result<(), VibeEngineError>
Closes listeners, work-store resources, and log-store resources.
§Returns
Ok(()) when all resources close, or VibeEngineError on close failure.
Auto Trait Implementations§
impl !Freeze for VibeEngineContext
impl !RefUnwindSafe for VibeEngineContext
impl !UnwindSafe for VibeEngineContext
impl Send for VibeEngineContext
impl Sync for VibeEngineContext
impl Unpin for VibeEngineContext
impl UnsafeUnpin for VibeEngineContext
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more