pub struct LeanWorkerSessionKey { /* private fields */ }Expand description
Worker reuse key for a capability-backed session.
A session key answers only one pool question: can an already-open child session safely host compatible work? It is not a downstream cache key, and it does not encode row schemas, cache validity, ranking, reporting, or source provenance.
Implementations§
Source§impl LeanWorkerSessionKey
impl LeanWorkerSessionKey
Sourcepub fn new(
project_root: impl Into<PathBuf>,
package: impl Into<String>,
lib_name: impl Into<String>,
imports: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( project_root: impl Into<PathBuf>, package: impl Into<String>, lib_name: impl Into<String>, imports: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Create a session key from the caller-visible capability requirements.
Sourcepub fn metadata_expectation(
self,
export: impl Into<String>,
request: Value,
expected: Option<LeanWorkerCapabilityMetadata>,
) -> Self
pub fn metadata_expectation( self, export: impl Into<String>, request: Value, expected: Option<LeanWorkerCapabilityMetadata>, ) -> Self
Add the metadata expectation used to decide safe session reuse.
expected is downstream metadata transported by the generic metadata
envelope. The pool compares it as opaque facts and does not interpret
command names or semantic versions.
Sourcepub fn restart_policy_class(self, class: LeanWorkerRestartPolicyClass) -> Self
pub fn restart_policy_class(self, class: LeanWorkerRestartPolicyClass) -> Self
Set the coarse restart-policy class for this session key.
Sourcepub fn project_root(&self) -> &Path
pub fn project_root(&self) -> &Path
Return the Lake project root for this session key.
Sourcepub fn toolchain_fingerprint(&self) -> &ToolchainFingerprint
pub fn toolchain_fingerprint(&self) -> &ToolchainFingerprint
Return the build-baked Lean toolchain fingerprint used by this key.
Sourcepub fn policy_class(&self) -> LeanWorkerRestartPolicyClass
pub fn policy_class(&self) -> LeanWorkerRestartPolicyClass
Return the restart-policy class used by this key.
Trait Implementations§
Source§impl Clone for LeanWorkerSessionKey
impl Clone for LeanWorkerSessionKey
Source§fn clone(&self) -> LeanWorkerSessionKey
fn clone(&self) -> LeanWorkerSessionKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LeanWorkerSessionKey
impl Debug for LeanWorkerSessionKey
Source§impl PartialEq for LeanWorkerSessionKey
impl PartialEq for LeanWorkerSessionKey
Source§fn eq(&self, other: &LeanWorkerSessionKey) -> bool
fn eq(&self, other: &LeanWorkerSessionKey) -> bool
self and other values to be equal, and is used by ==.