pub struct Invocation {
pub origin: Entity,
pub target: Entity,
pub payload: TransportMap,
pub id: Uuid,
pub tx_id: Uuid,
pub inherent: Option<InherentData>,
pub config: Option<Serialized>,
}
Expand description
A complete invocation request.
Fields§
§origin: Entity
The entity that originated the request.
target: Entity
The target of the invocation.
payload: TransportMap
The payload.
id: Uuid
The invocation id.
tx_id: Uuid
The transaction id, to map together a string of invocations.
inherent: Option<InherentData>
Inherent data associated with the transaction.
config: Option<Serialized>
Configuration associated with the invocation.
Implementations§
Source§impl Invocation
impl Invocation
Sourcepub fn new(
origin: Entity,
target: Entity,
payload: TransportMap,
inherent: Option<InherentData>,
) -> Invocation
pub fn new( origin: Entity, target: Entity, payload: TransportMap, inherent: Option<InherentData>, ) -> Invocation
Creates an invocation with a new transaction id.
Sourcepub fn into_v1_parts<C>(self) -> Result<(PacketMap, Option<C>), Error>where
C: Debug + DeserializeOwned,
pub fn into_v1_parts<C>(self) -> Result<(PacketMap, Option<C>), Error>where
C: Debug + DeserializeOwned,
Creates an invocation with a new transaction id.
Sourcepub fn next(
tx_id: Uuid,
origin: Entity,
target: Entity,
payload: TransportMap,
inherent: Option<InherentData>,
) -> Invocation
pub fn next( tx_id: Uuid, origin: Entity, target: Entity, payload: TransportMap, inherent: Option<InherentData>, ) -> Invocation
Creates an invocation with a specific transaction id, to correlate a chain of. invocations.
Sourcepub fn new_test(
msg: &str,
target: Entity,
payload: impl Into<PacketMap>,
inherent: Option<InherentData>,
) -> Invocation
pub fn new_test( msg: &str, target: Entity, payload: impl Into<PacketMap>, inherent: Option<InherentData>, ) -> Invocation
Creates an invocation with a Test origin.
Sourcepub fn timestamp(&self) -> Option<u64>
pub fn timestamp(&self) -> Option<u64>
Get the timestamp associated with an invocation if it exists.
Sourcepub fn target_url(&self) -> String
pub fn target_url(&self) -> String
Utility function to get the target Entity URL.
Sourcepub fn origin_url(&self) -> String
pub fn origin_url(&self) -> String
Utility function to get the origin Entity URL.
Trait Implementations§
Source§impl Clone for Invocation
impl Clone for Invocation
Source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Invocation
impl Debug for Invocation
Source§impl<'de> Deserialize<'de> for Invocation
impl<'de> Deserialize<'de> for Invocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Invocation
impl RefUnwindSafe for Invocation
impl Send for Invocation
impl Sync for Invocation
impl Unpin for Invocation
impl UnwindSafe for Invocation
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