Struct wasmcloud_core::Invocation
source · pub struct Invocation {
pub origin: WasmCloudEntity,
pub target: WasmCloudEntity,
pub operation: String,
pub msg: Vec<u8>,
pub id: String,
pub encoded_claims: String,
pub host_id: String,
pub content_length: u64,
pub trace_context: TraceContext,
}
Expand description
RPC message to capability provider
Fields§
§origin: WasmCloudEntity
§target: WasmCloudEntity
§operation: String
§msg: Vec<u8>
§id: String
§encoded_claims: String
§host_id: String
§content_length: u64
total message size
trace_context: TraceContext
Open Telemetry tracing support
Implementations§
source§impl Invocation
impl Invocation
sourcepub fn new(
cluster_key: &KeyPair,
host_key: &KeyPair,
origin: WasmCloudEntity,
target: WasmCloudEntity,
operation: impl Into<String>,
msg: Vec<u8>,
trace_context: TraceContext
) -> Result<Invocation>
pub fn new( cluster_key: &KeyPair, host_key: &KeyPair, origin: WasmCloudEntity, target: WasmCloudEntity, operation: impl Into<String>, msg: Vec<u8>, trace_context: TraceContext ) -> Result<Invocation>
Creates a new invocation. All invocations are signed with the cluster key as a way of preventing them from being forged over the network when connected to a lattice, and allows hosts to validate that the invocation is coming from a trusted source.
Arguments
links
- a map of package name to target name to entity, used internally to disambiguate between multiple links to the same provider or for actor-to-actor calls.cluster_key
- the cluster key used to sign the invocationhost_key
- the host key of the host that is creating the invocationorigin
- the origin of the invocationtarget
- the target of the invocationoperation
- the operation being invokedmsg
- the raw bytes of the invocation
sourcepub fn origin_url(&self) -> String
pub fn origin_url(&self) -> String
A fully-qualified URL indicating the origin of the invocation
sourcepub fn target_url(&self) -> String
pub fn target_url(&self) -> String
A fully-qualified URL indicating the target of the invocation
sourcepub fn validate_antiforgery(&self, valid_issuers: &[String]) -> Result<()>
pub fn validate_antiforgery(&self, valid_issuers: &[String]) -> Result<()>
Validates the current invocation to ensure that the invocation claims have not been forged, are not expired, etc
Trait Implementations§
source§impl Clone for Invocation
impl Clone for Invocation
source§fn clone(&self) -> Invocation
fn clone(&self) -> Invocation
Returns a copy 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 Default for Invocation
impl Default for Invocation
source§fn default() -> Invocation
fn default() -> Invocation
Returns the “default value” for a type. Read more
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 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