pub struct OdinProtocol { /* private fields */ }
Expand description
Main ODIN Protocol instance for AI-to-AI communication
Implementations§
Source§impl OdinProtocol
impl OdinProtocol
Sourcepub fn new(config: OdinConfig) -> Result<Self>
pub fn new(config: OdinConfig) -> Result<Self>
Create a new ODIN Protocol instance
Sourcepub async fn send_message(
&self,
target_node: &str,
content: &str,
priority: MessagePriority,
) -> Result<String>
pub async fn send_message( &self, target_node: &str, content: &str, priority: MessagePriority, ) -> Result<String>
Send a message to a specific node
Sourcepub async fn broadcast_message(
&self,
content: &str,
priority: MessagePriority,
) -> Result<String>
pub async fn broadcast_message( &self, content: &str, priority: MessagePriority, ) -> Result<String>
Broadcast a message to all connected nodes
Sourcepub fn subscribe_to_messages(&self) -> Receiver<OdinMessage>
pub fn subscribe_to_messages(&self) -> Receiver<OdinMessage>
Subscribe to messages
Sourcepub fn get_metrics(&self) -> HashMap<String, f64>
pub fn get_metrics(&self) -> HashMap<String, f64>
Get protocol metrics
Sourcepub fn get_status(&self) -> NodeStatus
pub fn get_status(&self) -> NodeStatus
Get node status
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for OdinProtocol
impl !RefUnwindSafe for OdinProtocol
impl Send for OdinProtocol
impl Sync for OdinProtocol
impl Unpin for OdinProtocol
impl !UnwindSafe for OdinProtocol
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