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>

source

pub fn get_message(&self) -> &B

source

pub fn get_mut_message(&mut self) -> &mut B

source

pub fn get_sender(&self) -> Id

source

pub fn get_receiver(&self) -> Id

Trait Implementations§

source§

impl<Id: Clone + NodeId, B: Clone + Body> Clone for Package<Id, B>

source§

fn clone(&self) -> Package<Id, B>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Id: Debug + NodeId, B: Debug + Body> Debug for Package<Id, B>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Id: NodeId, B: Body> Display for Package<Id, B>

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
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>,

source§

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>,

source§

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.
source§

impl<Id, B> Serialize for Package<Id, B>
where Id: Serialize + NodeId, B: Serialize + Body,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

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>

§

impl<Id, B> Send for Package<Id, B>
where B: Send, Id: Send,

§

impl<Id, B> Sync for Package<Id, B>
where B: Sync, Id: Sync,

§

impl<Id, B> Unpin for Package<Id, B>
where B: Unpin, Id: Unpin,

§

impl<Id, B> UnwindSafe for Package<Id, B>
where B: UnwindSafe, Id: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Body for T
where T: Clone + Debug,

source§

impl<T> Readable for T
where T: Debug,

source§

impl<T> Writable for T
where T: Debug,