pub struct ServerStateConfig {
pub journal_dir: PathBuf,
pub shared_memgine: Option<Arc<Mutex<MemgineEngine>>>,
pub inference: Option<Arc<InferenceEngine>>,
}Expand description
Builder for constructing a ServerState with embedder-supplied
dependencies. Embedders (e.g. tokhn-daemon) use this to inject
their own memgine handle and other shared infrastructure; the
standalone car-server binary uses ServerState::standalone
which calls with_config under the hood.
Fields§
§journal_dir: PathBufOptional pre-constructed memgine engine. When None, each
create_session call builds a fresh engine; embedders that want
to share a single engine across sessions can supply a clone of
their Arc<Mutex<MemgineEngine>> here.
inference: Option<Arc<InferenceEngine>>Optional pre-constructed inference engine.
Implementations§
Source§impl ServerStateConfig
impl ServerStateConfig
Sourcepub fn new(journal_dir: PathBuf) -> Self
pub fn new(journal_dir: PathBuf) -> Self
Minimal config suitable for the standalone car-server binary: only the journal dir is required; everything else is lazily constructed at first use.
pub fn with_inference(self, engine: Arc<InferenceEngine>) -> Self
Auto Trait Implementations§
impl Freeze for ServerStateConfig
impl !RefUnwindSafe for ServerStateConfig
impl Send for ServerStateConfig
impl Sync for ServerStateConfig
impl Unpin for ServerStateConfig
impl UnsafeUnpin for ServerStateConfig
impl !UnwindSafe for ServerStateConfig
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
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more