pub struct ActorStore { /* private fields */ }Implementations§
Source§impl ActorStore
impl ActorStore
pub fn new(pool: SqlitePool) -> Self
Sourcepub async fn get(&self, actor_id: &str) -> KernelResult<Option<ActorRecord>>
pub async fn get(&self, actor_id: &str) -> KernelResult<Option<ActorRecord>>
Look up an actor by ID. Returns None if not found.
Sourcepub async fn exists(&self, actor_id: &str) -> KernelResult<bool>
pub async fn exists(&self, actor_id: &str) -> KernelResult<bool>
Check if an actor exists in the actors table.
Sourcepub async fn is_active(&self, actor_id: &str) -> KernelResult<bool>
pub async fn is_active(&self, actor_id: &str) -> KernelResult<bool>
Check if an actor is active (exists and status = ‘active’).
Sourcepub async fn create_in_tx(
&self,
tx: &mut Transaction<'_, Sqlite>,
spec: &CreateActorSpec,
) -> KernelResult<()>
pub async fn create_in_tx( &self, tx: &mut Transaction<'_, Sqlite>, spec: &CreateActorSpec, ) -> KernelResult<()>
Insert a new actor within an existing transaction.
Sourcepub async fn set_status_in_tx(
&self,
tx: &mut Transaction<'_, Sqlite>,
actor_id: &str,
status: &ActorStatus,
) -> KernelResult<()>
pub async fn set_status_in_tx( &self, tx: &mut Transaction<'_, Sqlite>, actor_id: &str, status: &ActorStatus, ) -> KernelResult<()>
Update an actor’s status within an existing transaction.
Sourcepub async fn next_sequence(
&self,
creator_id: &str,
purpose: &str,
) -> KernelResult<i64>
pub async fn next_sequence( &self, creator_id: &str, purpose: &str, ) -> KernelResult<i64>
Get the next sequence number for a given creator + purpose pair. Used for derived identity (agent ID generation).
List all active actors with energy_share > 0. Returns (actor_id, energy_share) pairs for energy production distribution (PIP-001 §3).
Sourcepub async fn list_children(
&self,
parent_id: &str,
) -> KernelResult<Vec<ActorRecord>>
pub async fn list_children( &self, parent_id: &str, ) -> KernelResult<Vec<ActorRecord>>
List all direct children of a given actor.
Sourcepub async fn list_descendants(
&self,
ancestor_id: &str,
) -> KernelResult<Vec<ActorRecord>>
pub async fn list_descendants( &self, ancestor_id: &str, ) -> KernelResult<Vec<ActorRecord>>
List all active descendants of a given actor — actors whose lineage JSON array contains the ancestor_id.
Used for cascade freeze operations. When an actor is frozen, all actors in its subtree (identified by lineage) are also frozen.
Trait Implementations§
Source§impl Clone for ActorStore
impl Clone for ActorStore
Source§fn clone(&self) -> ActorStore
fn clone(&self) -> ActorStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ActorStore
impl !RefUnwindSafe for ActorStore
impl Send for ActorStore
impl Sync for ActorStore
impl Unpin for ActorStore
impl UnsafeUnpin for ActorStore
impl !UnwindSafe for ActorStore
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more