pub struct EffectiveScope { /* private fields */ }Expand description
Lightweight ReadFrame carrier used by AI command entry points
(SEARCH SIMILAR, SEARCH CONTEXT, ASK).
Issue #119 calls this struct EffectiveScope. It bundles the
(tenant, identity, role, visible_collections, snapshot) tuple so
every AI runtime entry can pass one value to AuthorizedSearch
instead of re-reading thread-locals at every call site.
Built via RedDBRuntime::ai_scope() which sources tenant + identity
from the per-statement thread-locals (identical to how
StatementExecutionFrame::build derives them) and resolves
visible_collections via the AuthStore cache.
Implementations§
Source§impl EffectiveScope
impl EffectiveScope
Sourcepub fn has_capability(&self, _capability: &str) -> bool
pub fn has_capability(&self, _capability: &str) -> bool
Capability check used by the AI runtime (runtime/ai/ner.rs)
to gate LLM-backed NER calls behind ai:ner:read.
Placeholder for now: always returns false. The auth engine’s
capability matrix is future work; until it lands, every routed
LLM-NER call denies at the gate and extract_tokens_routed’s
heuristic fallback fires (see ask_pipeline::extract_tokens_routed).
Documented in code so the wire-up is a one-line change once
the auth engine learns capabilities.
Auto Trait Implementations§
impl Freeze for EffectiveScope
impl RefUnwindSafe for EffectiveScope
impl Send for EffectiveScope
impl Sync for EffectiveScope
impl Unpin for EffectiveScope
impl UnsafeUnpin for EffectiveScope
impl UnwindSafe for EffectiveScope
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
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>
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>
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 moreSource§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