pub struct ExecutionScope {
pub tenant_id: TenantId,
pub user_id: UserId,
pub session_id: SessionId,
pub thread_id: ThreadId,
pub task_id: Option<TaskId>,
}Expand description
Execution scope — flows through every storage operation.
Isolation rules:
- tenant_id: complete isolation. Tenant A never sees Tenant B.
- user_id: within tenant, users share collective but not private memory.
- session_id: within user, sessions share long-term memory but not in-progress state.
- thread_id: within session, threads are independent conversations.
- task_id: within thread, tasks track specific work items.
Fields§
§tenant_id: TenantId§user_id: UserId§session_id: SessionId§thread_id: ThreadId§task_id: Option<TaskId>Implementations§
Source§impl ExecutionScope
impl ExecutionScope
pub fn new( tenant_id: impl Into<String>, user_id: impl Into<String>, session_id: impl Into<String>, thread_id: impl Into<String>, ) -> Self
pub fn with_task(self, task_id: impl Into<String>) -> Self
Sourcepub fn namespace(&self) -> &str
pub fn namespace(&self) -> &str
SurrealDB namespace for this scope — tenant-level isolation.
Maps to db.use_ns(scope.namespace()). Each tenant gets a separate
SurrealDB namespace — complete isolation at the storage layer.
No query can cross namespace boundaries.
Used by SurrealCheckpointer at construction time and
by SurrealMemoryStore per-call via scoped().
Trait Implementations§
Source§impl Clone for ExecutionScope
impl Clone for ExecutionScope
Source§fn clone(&self) -> ExecutionScope
fn clone(&self) -> ExecutionScope
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 ExecutionScope
impl Debug for ExecutionScope
Source§impl<'de> Deserialize<'de> for ExecutionScope
impl<'de> Deserialize<'de> for ExecutionScope
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
Auto Trait Implementations§
impl Freeze for ExecutionScope
impl RefUnwindSafe for ExecutionScope
impl Send for ExecutionScope
impl Sync for ExecutionScope
impl Unpin for ExecutionScope
impl UnsafeUnpin for ExecutionScope
impl UnwindSafe for ExecutionScope
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