pub struct CapabilityRequest<T = Vec<u8>> {
pub capability: String,
pub action: String,
pub payload: T,
pub content_type: CapabilityContentType,
}Expand description
A serialized capability invocation request.
Default T = Vec<u8> is the on-wire form. Any T: WirePayload can
go onto the wire via self.into_wire() (which calls
WirePayload::into_wire_bytes on the payload and updates content_type).
Fields§
§capability: StringMatches a registered WasmCapability::name().
action: StringThe action to perform (e.g. “read”, “write”, “capture”).
payload: TThe typed payload.
content_type: CapabilityContentTypePayload encoding.
Implementations§
Source§impl<T: WirePayload> CapabilityRequest<T>
impl<T: WirePayload> CapabilityRequest<T>
Sourcepub fn into_wire(self) -> CapabilityRequest<Vec<u8>>
pub fn into_wire(self) -> CapabilityRequest<Vec<u8>>
Convert a typed request into the wire form.
Calls WirePayload::into_wire_bytes(self.payload) and sets
content_type from the result.
Source§impl CapabilityRequest<Vec<u8>>
impl CapabilityRequest<Vec<u8>>
Sourcepub fn into_typed<T: WirePayload>(
self,
) -> Result<CapabilityRequest<T>, WireError>
pub fn into_typed<T: WirePayload>( self, ) -> Result<CapabilityRequest<T>, WireError>
Trait Implementations§
Source§impl<T: Clone> Clone for CapabilityRequest<T>
impl<T: Clone> Clone for CapabilityRequest<T>
Auto Trait Implementations§
impl<T> Freeze for CapabilityRequest<T>where
T: Freeze,
impl<T> RefUnwindSafe for CapabilityRequest<T>where
T: RefUnwindSafe,
impl<T> Send for CapabilityRequest<T>where
T: Send,
impl<T> Sync for CapabilityRequest<T>where
T: Sync,
impl<T> Unpin for CapabilityRequest<T>where
T: Unpin,
impl<T> UnsafeUnpin for CapabilityRequest<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CapabilityRequest<T>where
T: UnwindSafe,
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