pub struct ProtocolRegistry { /* private fields */ }Expand description
协作协议注册表
管理所有已注册的协作协议,供 LLM 选择
Implementations§
Source§impl ProtocolRegistry
impl ProtocolRegistry
Sourcepub fn new() -> ProtocolRegistry
pub fn new() -> ProtocolRegistry
创建新的协议注册表
Sourcepub async fn register(
&self,
protocol: Arc<dyn CollaborationProtocol>,
) -> Result<(), Error>
pub async fn register( &self, protocol: Arc<dyn CollaborationProtocol>, ) -> Result<(), Error>
注册协作协议
Sourcepub async fn list_all(&self) -> Vec<Arc<dyn CollaborationProtocol>>
pub async fn list_all(&self) -> Vec<Arc<dyn CollaborationProtocol>>
获取所有协议(供 LLM 选择)
Sourcepub async fn list_names(&self) -> Vec<String>
pub async fn list_names(&self) -> Vec<String>
列出所有协议名称
Sourcepub async fn get_descriptions(&self) -> HashMap<String, ProtocolDescription>
pub async fn get_descriptions(&self) -> HashMap<String, ProtocolDescription>
获取协议描述(供 LLM 理解)
Trait Implementations§
Source§impl Clone for ProtocolRegistry
impl Clone for ProtocolRegistry
Source§fn clone(&self) -> ProtocolRegistry
fn clone(&self) -> ProtocolRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for ProtocolRegistry
impl Default for ProtocolRegistry
Source§fn default() -> ProtocolRegistry
fn default() -> ProtocolRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProtocolRegistry
impl !RefUnwindSafe for ProtocolRegistry
impl Send for ProtocolRegistry
impl Sync for ProtocolRegistry
impl Unpin for ProtocolRegistry
impl UnsafeUnpin for ProtocolRegistry
impl !UnwindSafe for ProtocolRegistry
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> 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>
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 moreSource§impl<T> Message for T
impl<T> Message for T
Source§fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
fn from_boxed(m: BoxedMessage) -> Result<Self, BoxedDowncastErr>
Convert a BoxedMessage to this concrete type
Source§fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
fn box_message(self, pid: &ActorId) -> Result<BoxedMessage, BoxedDowncastErr>
Convert this message to a BoxedMessage