pub struct CommunicationEndpoint { /* private fields */ }Expand description
Communication endpoint for a node
Implementations§
Source§impl CommunicationEndpoint
impl CommunicationEndpoint
Sourcepub fn new(nodeid: String, address: SocketAddr) -> Self
pub fn new(nodeid: String, address: SocketAddr) -> Self
Create a new communication endpoint
Sourcepub fn send_message(&self, message: DistributedMessage) -> CoreResult<()>
pub fn send_message(&self, message: DistributedMessage) -> CoreResult<()>
Send a message to another node
Sourcepub fn register_handler<H>(
&self,
messagetype: String,
handler: H,
) -> CoreResult<()>
pub fn register_handler<H>( &self, messagetype: String, handler: H, ) -> CoreResult<()>
Register a message handler
Sourcepub fn process_messages(&self) -> CoreResult<()>
pub fn process_messages(&self) -> CoreResult<()>
Process incoming messages
Sourcepub fn address(&self) -> SocketAddr
pub fn address(&self) -> SocketAddr
Get address
Auto Trait Implementations§
impl Freeze for CommunicationEndpoint
impl RefUnwindSafe for CommunicationEndpoint
impl Send for CommunicationEndpoint
impl Sync for CommunicationEndpoint
impl Unpin for CommunicationEndpoint
impl UnwindSafe for CommunicationEndpoint
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