pub struct LocalBackends {
pub runtime_backends: RuntimeBackends,
pub db: SqliteDb,
pub task_registry: Arc<LocalSessionTaskRegistry>,
pub profile: LocalProfile,
/* private fields */
}Expand description
The local stores plus a ready-to-use RuntimeBackends.
runtime_backends carries whatever store set / event bus the caller passed
in, plus the local SQLite-backed task registry and schedule store factory
attached here. The platform store factory is attached separately via
LocalBackends::with_platform_runner once the embedder supplies a
LocalSessionRunner (the runner usually wraps the runtime built from these
backends, hence the two-step wiring).
Fields§
§runtime_backends: RuntimeBackendsComposable runtime backend bundle (caller bus preserved).
db: SqliteDbShared SQLite handle backing the local stores.
task_registry: Arc<LocalSessionTaskRegistry>SQLite-backed task registry (also installed on runtime_backends).
profile: LocalProfileProfile used to build the stores.
Implementations§
Source§impl LocalBackends
impl LocalBackends
Sourcepub fn new(
profile: LocalProfile,
runtime_backends: RuntimeBackends,
) -> Result<Self>
pub fn new( profile: LocalProfile, runtime_backends: RuntimeBackends, ) -> Result<Self>
Build local backends from a profile and caller-provided composable
pieces. The event bus and any custom stores already configured on
runtime_backends are preserved; this only attaches the local task
registry and schedule store factory.
The SQLite database is opened at profile.db_path(); the data directory
is created if needed.
Sourcepub fn with_db(
profile: LocalProfile,
runtime_backends: RuntimeBackends,
db: SqliteDb,
) -> Result<Self>
pub fn with_db( profile: LocalProfile, runtime_backends: RuntimeBackends, db: SqliteDb, ) -> Result<Self>
Build local backends over an already-open SQLite handle (e.g. an in-memory DB for tests).
Sourcepub fn schedule_store(&self) -> Result<LocalScheduleStore>
pub fn schedule_store(&self) -> Result<LocalScheduleStore>
Build a LocalScheduleStore directly (for the embedder that wants the
concrete type and its additive metadata methods).
Sourcepub fn with_platform_runner(self, runner: Arc<dyn LocalSessionRunner>) -> Self
pub fn with_platform_runner(self, runner: Arc<dyn LocalSessionRunner>) -> Self
Attach a platform store factory built from a caller-supplied
LocalSessionRunner. Call this after the runtime (and therefore the
runner) exists. The factory hands out a LocalPlatformStore per
(org, session); the runner is the source of truth for local session
state, so no extra store handles are required.
pub fn owner_principal_id(&self) -> PrincipalId
Auto Trait Implementations§
impl !RefUnwindSafe for LocalBackends
impl !UnwindSafe for LocalBackends
impl Freeze for LocalBackends
impl Send for LocalBackends
impl Sync for LocalBackends
impl Unpin for LocalBackends
impl UnsafeUnpin for LocalBackends
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request