Skip to main content

Relay

Struct Relay 

Source
pub struct Relay { /* private fields */ }

Implementations§

Source§

impl Relay

Source

pub fn new(roster_size: usize, max_rounds: usize) -> Self

Source

pub fn strategy(&self) -> CollaborationStrategy

Source

pub fn set_strategy(&mut self, strategy: CollaborationStrategy)

Change routing for future turns. This does not discard queued work or alter the public context journal; it only affects the next automatic recipient. Pair selection is re-derived from the next first value.

Source

pub fn active_slots(&self) -> impl Iterator<Item = RosterSlot> + '_

Source

pub fn pause(&mut self)

Source

pub fn resume(&mut self)

Source

pub fn tombstone(&mut self, slot: RosterSlot) -> Result<(), &'static str>

Source

pub fn mark_limited(&mut self, slot: RosterSlot) -> Result<(), &'static str>

Flag a slot whose provider plan is exhausted. Routing skips it but its queued prompts and roster identity are preserved for a later recharge.

Source

pub fn clear_limited(&mut self, slot: RosterSlot) -> Result<(), &'static str>

Clear a usage-limit flag after a recharge or adapter reload.

Source

pub fn is_limited(&self, slot: RosterSlot) -> bool

Source

pub fn routable_slots(&self) -> impl Iterator<Item = RosterSlot> + '_

Slots that can currently receive a turn.

Source

pub fn reactivate(&mut self, slot: RosterSlot) -> Result<(), &'static str>

Source

pub fn drop_agent(&mut self, slot: RosterSlot) -> Result<(), &'static str>

Source

pub fn swap_agents( &mut self, first: RosterSlot, second: RosterSlot, ) -> Result<(), &'static str>

Exchange two live roster slots while preserving adapter identity in queued work, routing cursors, and per-agent context watermarks.

Source

pub fn enqueue_human( &mut self, prompt: impl Into<String>, selected: Option<RosterSlot>, ) -> bool

Source

pub fn enqueue_direct( &mut self, slot: RosterSlot, prompt: impl Into<String>, ) -> Result<bool, &'static str>

Source

pub fn queued_count(&self) -> usize

Source

pub fn set_shared_task(&mut self, task: impl Into<String>)

Source

pub fn shared_task(&self) -> Option<&str>

Source

pub fn record_public( &mut self, speaker: impl Into<String>, text: impl Into<String>, )

Source

pub fn mark_context_seen(&mut self, slot: RosterSlot)

Source

pub fn unseen_context(&mut self, slot: RosterSlot) -> String

Source

pub fn add_agent(&mut self)

Source

pub fn begin( &mut self, initial_prompt: impl Into<String>, first: RosterSlot, ) -> RelayDecision

Select the next causal turn. Direct work always precedes steering work.

Source

pub fn finish(&mut self, slot: RosterSlot, direct: bool, accepted_stop: bool)

Finalize a dispatched turn and choose the next ring position. Direct turns never become shared relay context.

Source

pub fn finish_with_handoff( &mut self, slot: RosterSlot, direct: bool, accepted_stop: bool, target: Option<RosterSlot>, )

A public Roster turn may nominate its next peer. User queues, stop eligibility, and the automated turn limit retain their normal priority.

Trait Implementations§

Source§

impl Clone for Relay

Source§

fn clone(&self) -> Relay

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Relay

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Relay

Source§

impl PartialEq for Relay

Source§

fn eq(&self, other: &Relay) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Relay

Auto Trait Implementations§

§

impl Freeze for Relay

§

impl RefUnwindSafe for Relay

§

impl Send for Relay

§

impl Sync for Relay

§

impl Unpin for Relay

§

impl UnsafeUnpin for Relay

§

impl UnwindSafe for Relay

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.