Struct wamp_core::messages::invocation::Invocation
source · pub struct Invocation {
pub request_id: u64,
pub registration: u64,
pub details: Value,
pub args: Value,
pub kwargs: Value,
}
Expand description
Invocation - wamp-proto
Represents an invocation message in the WAMP protocol.
Examples
use wamp_core::messages::Invocation;
use wamp_core::invocation;
use serde_json::{json, Value};
let invocation = Invocation {
request_id: 1,
registration: 2,
details: json!({}),
args: Value::Null,
kwargs: Value::Null
};
let invocation2 = invocation!(2);
assert_eq!(invocation, invocation2);
Serializer
Serde Serialize trait implementation for invocation.
use wamp_core::messages::Invocation;
use serde_json::{json, to_string};
let invocation = Invocation {
request_id: 1,
registration: 2,
details: json!({}),
args: json!([1, 2, 3]),
kwargs: json!({"key": "value"})
};
let invocation2_string = r#"[68,1,2,{},[1,2,3],{"key":"value"}]"#;
let invocation_string = to_string(&invocation).unwrap();
assert_eq!(invocation_string, invocation2_string);
Deserializer
Serde Deserialize trait implementation for invocation.
use wamp_core::messages::Invocation;
use serde_json::{json, from_str};
let invocation = Invocation {
request_id: 1,
registration: 2,
details: json!({}),
args: json!([1, 2, 3]),
kwargs: json!({"key": "value"})
};
let invocation2_string = r#"[68,1,2,{},[1,2,3],{"key":"value"}]"#;
let invocation2 = from_str::<Invocation>(invocation2_string).unwrap();
assert_eq!(invocation, invocation2);
Fields§
§request_id: u64
§registration: u64
§details: Value
§args: Value
§kwargs: Value
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<'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
source§impl From<Invocation> for Messages
impl From<Invocation> for Messages
source§fn from(v: Invocation) -> Messages
fn from(v: Invocation) -> Messages
Converts to this type from the input type.
source§impl From<Messages> for Invocation
impl From<Messages> for Invocation
source§fn from(v: Messages) -> Invocation
fn from(v: Messages) -> Invocation
Converts to this type from the input type.
source§impl PartialEq for Invocation
impl PartialEq for Invocation
source§fn eq(&self, other: &Invocation) -> bool
fn eq(&self, other: &Invocation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Invocation
impl Serialize for Invocation
source§impl TryFrom<Invocation> for Message
impl TryFrom<Invocation> for Message
source§impl WampMessage for Invocation
impl WampMessage for Invocation
impl Eq for Invocation
impl StructuralEq for Invocation
impl StructuralPartialEq for Invocation
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