Struct reactive_messaging::prelude::Peer
source · pub struct Peer<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType: 'static + Send + Sync + PartialEq + Debug + ReactiveMessagingSerializer<MessagesType>> {
pub peer_id: u32,
pub sender: Arc<Atomic<'static, MessagesType, BUFFERED_MESSAGES_PER_PEER_COUNT, 1>>,
pub peer_address: SocketAddr,
}
Expand description
Represents a channel to a peer able to send out MessageType
kinds of messages from “here” to “there”
Fields§
§peer_id: u32
§sender: Arc<Atomic<'static, MessagesType, BUFFERED_MESSAGES_PER_PEER_COUNT, 1>>
§peer_address: SocketAddr
Implementations§
source§impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType: 'static + Send + Sync + PartialEq + Debug + ReactiveMessagingSerializer<MessagesType>> Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType: 'static + Send + Sync + PartialEq + Debug + ReactiveMessagingSerializer<MessagesType>> Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
pub fn new( sender: Arc<Atomic<'static, MessagesType, BUFFERED_MESSAGES_PER_PEER_COUNT, 1>>, peer_address: SocketAddr ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType> !RefUnwindSafe for Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType> Send for Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType> Sync for Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType> Unpin for Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
impl<const BUFFERED_MESSAGES_PER_PEER_COUNT: usize, MessagesType> !UnwindSafe for Peer<BUFFERED_MESSAGES_PER_PEER_COUNT, MessagesType>
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