pub struct AgentManager {
pub db: Arc<Mutex<Connection>>,
/* private fields */
}Fields§
§db: Arc<Mutex<Connection>>Implementations§
Source§impl AgentManager
impl AgentManager
pub fn new(db: Connection) -> Self
pub async fn spawn(&self, manifest: AgentManifest) -> Result<ProcessId>
pub async fn stop(&self, pid: ProcessId) -> Result<StopResult>
pub fn pause(&self, pid: ProcessId) -> Result<()>
pub fn resume(&self, pid: ProcessId) -> Result<()>
pub fn list(&self) -> Vec<AgentStatus>
pub fn get_state(&self, pid: ProcessId) -> Option<LifecycleState>
Sourcepub fn enforce_budget(&self, pid: ProcessId) -> Result<bool>
pub fn enforce_budget(&self, pid: ProcessId) -> Result<bool>
Check if agent has exceeded its token budget; if so, pause it and return true.
Auto Trait Implementations§
impl Freeze for AgentManager
impl RefUnwindSafe for AgentManager
impl Send for AgentManager
impl Sync for AgentManager
impl Unpin for AgentManager
impl UnsafeUnpin for AgentManager
impl UnwindSafe for AgentManager
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
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>
Converts
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>
Converts
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