pub struct Envelope {
pub kind: Kind,
pub request_id: u64,
pub method: String,
pub args: Vec<Arg>,
pub payload: Vec<u8>,
pub caps: Vec<CapDescriptor>,
pub redact: bool,
pub read_only: bool,
}Expand description
One Active RPC envelope.
Fields§
§kind: KindEnvelope kind.
request_id: u64Request id, echoed by the response.
method: StringMethod name (requests) or error code (errors).
args: Vec<Arg>Arguments, in order.
payload: Vec<u8>Optional Infinity payload (module bytes).
caps: Vec<CapDescriptor>Capability descriptors travelling with this envelope.
redact: boolRedaction hint.
read_only: boolRead-only hint.
Implementations§
Source§impl Envelope
impl Envelope
Sourcepub fn request(
request_id: u64,
method: impl Into<String>,
args: Vec<Arg>,
) -> Self
pub fn request( request_id: u64, method: impl Into<String>, args: Vec<Arg>, ) -> Self
A request envelope.
Sourcepub fn with_payload(self, payload: Vec<u8>) -> Self
pub fn with_payload(self, payload: Vec<u8>) -> Self
Attach an Infinity payload.
Sourcepub fn with_caps(self, caps: Vec<CapDescriptor>) -> Self
pub fn with_caps(self, caps: Vec<CapDescriptor>) -> Self
Attach capability descriptors.
Sourcepub fn decode_with(bytes: &[u8], limits: WireLimits) -> Result<Envelope>
pub fn decode_with(bytes: &[u8], limits: WireLimits) -> Result<Envelope>
Parse with explicit limits.
Sourcepub fn first_value(&self) -> Option<&Value>
pub fn first_value(&self) -> Option<&Value>
The first value argument, when present.
Trait Implementations§
impl StructuralPartialEq for Envelope
Auto Trait Implementations§
impl Freeze for Envelope
impl RefUnwindSafe for Envelope
impl Send for Envelope
impl Sync for Envelope
impl Unpin for Envelope
impl UnsafeUnpin for Envelope
impl UnwindSafe for Envelope
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