pub struct ParallelProtocol { /* private fields */ }Expand description
并行协作协议
Implementations§
Trait Implementations§
Source§impl CollaborationProtocol for ParallelProtocol
impl CollaborationProtocol for ParallelProtocol
Source§fn description(&self) -> &str
fn description(&self) -> &str
协议描述(供 LLM 理解)
Source§fn applicable_scenarios(&self) -> Vec<String>
fn applicable_scenarios(&self) -> Vec<String>
协议适用场景(供 LLM 参考选择)
Source§fn mode(&self) -> CollaborationMode
fn mode(&self) -> CollaborationMode
获取协作模式
Source§fn send_message<'life0, 'async_trait>(
&'life0 self,
msg: CollaborationMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 self,
msg: CollaborationMessage,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
发送消息
Source§fn receive_message<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<CollaborationMessage>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
fn receive_message<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<CollaborationMessage>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
接收消息
Source§fn process_message<'life0, 'async_trait>(
&'life0 self,
msg: CollaborationMessage,
) -> Pin<Box<dyn Future<Output = Result<CollaborationResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
fn process_message<'life0, 'async_trait>(
&'life0 self,
msg: CollaborationMessage,
) -> Pin<Box<dyn Future<Output = Result<CollaborationResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ParallelProtocol: 'async_trait,
处理消息并返回结果 Read more
Source§fn is_available(&self) -> bool
fn is_available(&self) -> bool
检查协议是否可用
Auto Trait Implementations§
impl Freeze for ParallelProtocol
impl !RefUnwindSafe for ParallelProtocol
impl Send for ParallelProtocol
impl Sync for ParallelProtocol
impl Unpin for ParallelProtocol
impl UnsafeUnpin for ParallelProtocol
impl !UnwindSafe for ParallelProtocol
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> 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