pub struct SubAgentRegistry { /* private fields */ }Expand description
Tracks active sub-agent relationships per user
Implementations§
Source§impl SubAgentRegistry
impl SubAgentRegistry
pub fn new() -> Self
Sourcepub fn hired_count(&self, user_pubkey: &str) -> usize
pub fn hired_count(&self, user_pubkey: &str) -> usize
Get count of currently hired sub-agents
Sourcepub fn is_hired(&self, user_pubkey: &str, sub_agent_pubkey: &str) -> bool
pub fn is_hired(&self, user_pubkey: &str, sub_agent_pubkey: &str) -> bool
Check if a specific sub-agent is already hired
Sourcepub fn remove_hire(&mut self, user_pubkey: &str, sub_agent_pubkey: &str) -> bool
pub fn remove_hire(&mut self, user_pubkey: &str, sub_agent_pubkey: &str) -> bool
Remove a sub-agent (contract ended)
Sourcepub fn record_fee(&mut self, user_pubkey: &str, fee_lamports: u64)
pub fn record_fee(&mut self, user_pubkey: &str, fee_lamports: u64)
Record captured fee
Sourcepub fn total_fees(&self, user_pubkey: &str) -> u64
pub fn total_fees(&self, user_pubkey: &str) -> u64
Get total fees captured for a user
Sourcepub fn list_hires(&self, user_pubkey: &str) -> Vec<String>
pub fn list_hires(&self, user_pubkey: &str) -> Vec<String>
Get all active sub-agents for a user
Trait Implementations§
Source§impl Debug for SubAgentRegistry
impl Debug for SubAgentRegistry
Source§impl Default for SubAgentRegistry
impl Default for SubAgentRegistry
Source§fn default() -> SubAgentRegistry
fn default() -> SubAgentRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SubAgentRegistry
impl RefUnwindSafe for SubAgentRegistry
impl Send for SubAgentRegistry
impl Sync for SubAgentRegistry
impl Unpin for SubAgentRegistry
impl UnsafeUnpin for SubAgentRegistry
impl UnwindSafe for SubAgentRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
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 moreCreates a shared type from an unshared type.