pub struct Node { /* private fields */ }Expand description
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(
config: NodeConfig,
store: Arc<dyn ConversationStore>,
clock: Arc<dyn Clock>,
) -> Result<Self, Error>
pub fn new( config: NodeConfig, store: Arc<dyn ConversationStore>, clock: Arc<dyn Clock>, ) -> Result<Self, Error>
A node for config; file manifests are read now.
Sourcepub async fn start(&self) -> Vec<String>
pub async fn start(&self) -> Vec<String>
Fetches the manifests of URL teams, marks tasks left by a stop as failed, and returns problems worth a warning (this bot missing from a team, a manifest that cannot be read).
Sourcepub fn channels(&self) -> Vec<Arc<dyn Channel>>
pub fn channels(&self) -> Vec<Arc<dyn Channel>>
One peer:<team> channel per team: it serves the team’s endpoint (tasks when the team’s
accept allows them, relaying, refusals that say why) and the bot’s socket.
Trait Implementations§
Source§impl Peers for Node
impl Peers for Node
Source§fn directory<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn directory<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<PeerInfo>, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Members this bot may delegate to (the manifest’s links from this bot).
Source§fn delegate<'life0, 'async_trait>(
&'life0 self,
delegation: Delegation,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delegate<'life0, 'async_trait>(
&'life0 self,
delegation: Delegation,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Hands work to a member and waits up to
Delegation::wait for it to end.Source§fn status<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
team: &'life1 str,
peer: &'life2 str,
task: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn status<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
team: &'life1 str,
peer: &'life2 str,
task: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The current state of a task this bot delegated.
Source§fn cancel<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
team: &'life1 str,
peer: &'life2 str,
task: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn cancel<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
team: &'life1 str,
peer: &'life2 str,
task: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Asks the other bot to stop a task this bot delegated.
Source§fn report_usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
task: Option<&'life2 str>,
tokens: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn report_usage<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
task: Option<&'life2 str>,
tokens: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The tokens the turn answering the task of
conversation (task, or the oldest) used, its
own delegations included; reported with the task’s end.Source§fn progress(
&self,
conversation: &ConversationKey,
task: Option<&str>,
text: &str,
)
fn progress( &self, conversation: &ConversationKey, task: Option<&str>, text: &str, )
What the turn answering the task of
conversation (task, or the oldest) is doing now,
shown to the caller while the task works. Called from the agent’s output reader: quick.Source§fn fail<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
task: Option<&'life2 str>,
reason: &'life3 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn fail<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
task: Option<&'life2 str>,
reason: &'life3 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The runtime could not answer the task of
conversation (task, or the oldest): it fails
with reason instead of completing with a fixed reply.Source§fn answer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 PeerTask,
prompt: &'life2 str,
button: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn answer<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
task: &'life1 PeerTask,
prompt: &'life2 str,
button: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<PeerTask, PeerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Answers the question of a task waiting for input (the origin person pressed
button).Source§fn caller<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
) -> Pin<Box<dyn Future<Output = Option<PeerCaller>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn caller<'life0, 'life1, 'async_trait>(
&'life0 self,
conversation: &'life1 ConversationKey,
) -> Pin<Box<dyn Future<Output = Option<PeerCaller>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The authenticated sender of an inbound event of a peer channel;
None for other events.Auto Trait Implementations§
impl !RefUnwindSafe for Node
impl !UnwindSafe for Node
impl Freeze for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
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