pub enum WireMessage {
Push(WireExpression),
Pull(i64),
Resolve(i64, WireExpression),
Reject(i64, WireExpression),
Release(Vec<i64>),
Abort(WireExpression),
}
Expand description
Wire protocol message types
Variants§
Push(WireExpression)
[“push”, expression] - Push an expression for evaluation
Pull(i64)
[“pull”, import_id] - Pull a promise to get its resolved value
Resolve(i64, WireExpression)
[“resolve”, export_id, value] - Resolve a promise with a value
Reject(i64, WireExpression)
[“reject”, export_id, error] - Reject a promise with an error
Release(Vec<i64>)
[“release”, [import_ids…]] - Release/dispose capabilities
Abort(WireExpression)
[“abort”, error] - Abort the session with an error
Implementations§
Source§impl WireMessage
impl WireMessage
Sourcepub fn from_json_array(arr: &[JsonValue]) -> Result<Self, String>
pub fn from_json_array(arr: &[JsonValue]) -> Result<Self, String>
Parse a wire message from a JSON array
Sourcepub fn to_json_array(&self) -> Vec<JsonValue>
pub fn to_json_array(&self) -> Vec<JsonValue>
Convert to JSON array for wire format
Trait Implementations§
Source§impl Clone for WireMessage
impl Clone for WireMessage
Source§fn clone(&self) -> WireMessage
fn clone(&self) -> WireMessage
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 WireMessage
impl Debug for WireMessage
Source§impl PartialEq for WireMessage
impl PartialEq for WireMessage
impl StructuralPartialEq for WireMessage
Auto Trait Implementations§
impl Freeze for WireMessage
impl RefUnwindSafe for WireMessage
impl Send for WireMessage
impl Sync for WireMessage
impl Unpin for WireMessage
impl UnwindSafe for WireMessage
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