pub struct MessagePassingSystem { /* private fields */ }Expand description
Advanced distributed computing features Message passing system for inter-node communication
Implementations§
Source§impl MessagePassingSystem
impl MessagePassingSystem
Sourcepub fn send_message(
&self,
message: DistributedMessage,
) -> Result<(), DistributedError>
pub fn send_message( &self, message: DistributedMessage, ) -> Result<(), DistributedError>
Send message to another node
Sourcepub fn broadcast_message(
&self,
message_type: MessageType,
data: Vec<u8>,
) -> Result<(), DistributedError>
pub fn broadcast_message( &self, message_type: MessageType, data: Vec<u8>, ) -> Result<(), DistributedError>
Broadcast message to all nodes
Sourcepub fn register_handler(
&mut self,
message_type: String,
handler: MessageHandler,
)
pub fn register_handler( &mut self, message_type: String, handler: MessageHandler, )
Register message handler
Sourcepub fn process_messages(&self) -> Result<Vec<MessageResponse>, DistributedError>
pub fn process_messages(&self) -> Result<Vec<MessageResponse>, DistributedError>
Process incoming messages
Auto Trait Implementations§
impl Freeze for MessagePassingSystem
impl !RefUnwindSafe for MessagePassingSystem
impl Send for MessagePassingSystem
impl Sync for MessagePassingSystem
impl Unpin for MessagePassingSystem
impl !UnwindSafe for MessagePassingSystem
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> 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 more