pub struct IdentityScope {
pub model_id: String,
pub tokenizer_id: String,
pub adapter_id: Option<String>,
pub tenant_id: String,
}Expand description
Identity scope for safe KV reuse.
Two blocks may share a block_hash yet be unsafe to reuse across each other
unless their model, tokenizer, adapter, and tenant agree. Backends carry this
scope so reuse stays identity-aware instead of matching on content hash
alone. This is the seam where unsafe reuse (wrong model/tenant/adapter) is
rejected before it ever reaches a routing decision.
Fields§
§model_id: String§tokenizer_id: String§adapter_id: Option<String>§tenant_id: StringImplementations§
Source§impl IdentityScope
impl IdentityScope
pub fn from_key(key: &KvBlockKey) -> Self
Sourcepub fn matches(&self, key: &KvBlockKey) -> bool
pub fn matches(&self, key: &KvBlockKey) -> bool
Whether key belongs to this identity scope. Adapter identity must match
exactly (including absence): a LoRA-adapted block is not reusable by a
base-model request, and vice versa.
Trait Implementations§
Source§impl Clone for IdentityScope
impl Clone for IdentityScope
Source§fn clone(&self) -> IdentityScope
fn clone(&self) -> IdentityScope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdentityScope
impl Debug for IdentityScope
Source§impl<'de> Deserialize<'de> for IdentityScope
impl<'de> Deserialize<'de> for IdentityScope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for IdentityScope
Source§impl Hash for IdentityScope
impl Hash for IdentityScope
Source§impl PartialEq for IdentityScope
impl PartialEq for IdentityScope
Source§fn eq(&self, other: &IdentityScope) -> bool
fn eq(&self, other: &IdentityScope) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for IdentityScope
impl Serialize for IdentityScope
impl StructuralPartialEq for IdentityScope
Auto Trait Implementations§
impl Freeze for IdentityScope
impl RefUnwindSafe for IdentityScope
impl Send for IdentityScope
impl Sync for IdentityScope
impl Unpin for IdentityScope
impl UnsafeUnpin for IdentityScope
impl UnwindSafe for IdentityScope
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