Struct dcs2::communication::messages::Package
source · pub struct Package<Id: NodeId, B: Body> {
pub header: Header<Id>,
pub body: B,
}
Fields§
§header: Header<Id>
§body: B
Implementations§
source§impl<Id: NodeId, B: Body> Package<Id, B>
impl<Id: NodeId, B: Body> Package<Id, B>
pub fn get_message(&self) -> &B
pub fn get_mut_message(&mut self) -> &mut B
pub fn get_sender(&self) -> Id
pub fn get_receiver(&self) -> Id
Trait Implementations§
source§impl<Conn: Connection, Addr: Address, F, R: Router<Address = Addr>> InMsgQueue<Package<SystemNodeId, Vec<u8, MESSAGE_BUFFER_MAX_SIZE>>> for GenericCommunicationService<Conn, Addr, F, R>where
F: ConnectionFactory<Address = Addr, Connection = Conn>,
impl<Conn: Connection, Addr: Address, F, R: Router<Address = Addr>> InMsgQueue<Package<SystemNodeId, Vec<u8, MESSAGE_BUFFER_MAX_SIZE>>> for GenericCommunicationService<Conn, Addr, F, R>where
F: ConnectionFactory<Address = Addr, Connection = Conn>,
source§fn pop(&mut self) -> Option<GenericPackage>
fn pop(&mut self) -> Option<GenericPackage>
Returns some value from the queue or teturns None.
Blocking behavior is not guaranteed nor enforced by this method.
source§impl<Conn: Connection, Addr: Address, F, R: Router<Address = Addr>> OutMsgQueue<Package<SystemNodeId, Vec<u8, MESSAGE_BUFFER_MAX_SIZE>>> for GenericCommunicationService<Conn, Addr, F, R>where
F: ConnectionFactory<Address = Addr, Connection = Conn>,
impl<Conn: Connection, Addr: Address, F, R: Router<Address = Addr>> OutMsgQueue<Package<SystemNodeId, Vec<u8, MESSAGE_BUFFER_MAX_SIZE>>> for GenericCommunicationService<Conn, Addr, F, R>where
F: ConnectionFactory<Address = Addr, Connection = Conn>,
source§fn push(&mut self, pkg: GenericPackage)
fn push(&mut self, pkg: GenericPackage)
Pushes a value in the queue. Blocking behavior nor enforced is not guaranteed by this method.
Blocking behavior is not guaranteed nor enforced by this method.
impl<Conn: Connection, Addr: Address, F, R: Router<Address = Addr>> CommunicationService<Package<SystemNodeId, Vec<u8, MESSAGE_BUFFER_MAX_SIZE>>> for GenericCommunicationService<Conn, Addr, F, R>where
F: ConnectionFactory<Address = Addr, Connection = Conn>,
Auto Trait Implementations§
impl<Id, B> RefUnwindSafe for Package<Id, B>where
B: RefUnwindSafe,
Id: RefUnwindSafe,
impl<Id, B> Send for Package<Id, B>
impl<Id, B> Sync for Package<Id, B>
impl<Id, B> Unpin for Package<Id, B>
impl<Id, B> UnwindSafe for Package<Id, B>where
B: UnwindSafe,
Id: UnwindSafe,
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