pub struct SessionBuilder { /* private fields */ }Implementations§
Source§impl SessionBuilder
impl SessionBuilder
pub fn provider(self, provider: ProviderHandle) -> Self
pub fn session_spec(self, spec: SessionSpec) -> Self
pub fn parent(self, parent_session_id: impl Into<String>) -> Self
Sourcepub fn store(self, store: Arc<dyn RuntimePersistence>) -> Self
pub fn store(self, store: Arc<dyn RuntimePersistence>) -> Self
Use a specific persistence store for this root session.
This is the right API for a host-owned, pre-opened session database.
Managed child sessions never reuse this store; configure
LashCoreBuilder::child_store_factory when child sessions should also
persist.
pub fn plugin<P: PluginBinding>(self, config: P::SessionConfig) -> Self
pub async fn open(self) -> Result<LashSession>
Sourcepub async fn open_fresh(self) -> Result<LashSession>
pub async fn open_fresh(self) -> Result<LashSession>
Open this session with a fresh resident graph, ignoring any persisted session graph/checkpoint state that may already exist for the same session id.
The next successful commit writes a full replacement graph, so normal
embedders can use this to start over without manually calling
load_persisted_session_state or constructing a RuntimeSessionState.
Use Self::open for resume and Self::open_with_state only when
restoring explicit host-owned state.
Sourcepub async fn open_with_state(
self,
state: RuntimeSessionState,
) -> Result<LashSession>
pub async fn open_with_state( self, state: RuntimeSessionState, ) -> Result<LashSession>
Open with an explicitly supplied runtime state.
This is for advanced hosts that already own a complete state snapshot.
Normal embedders should use Self::open to resume according to Lash’s
residency policy or Self::open_fresh to start over and replace prior
persisted state on the next commit.