pub struct ClientHandle {
pub url: Value,
pub subscriptions: Value,
pub futures: Value,
pub rejections: Value,
/* private fields */
}Expand description
Typed client handle for the ws drive loop.
The loop owns one per frame and hands it to the venue’s handle_message;
venues read the four fields it exposes instead of get_value on a box.
Writes to subscriptions/futures reach the live client by tag.
Fields§
§url: Valueclient.url — Value::Str when the handle names a url, else Null.
subscriptions: Valueclient.subscriptions, exactly what get_value used to read.
futures: Valueclient.futures (open single-flights on this client).
rejections: Valueclient.rejections.
Implementations§
Source§impl ClientHandle
impl ClientHandle
pub fn from_value(value: Value) -> ClientHandle
pub fn url(&self) -> Option<String>
pub fn resolve(&self, args: &[Value]) -> Value
pub fn reject(&self, args: &[Value]) -> Value
pub fn send(&self, args: &[Value]) -> Value
pub fn reset(&self, error: Value) -> Value
pub fn on_pong(&self) -> Value
pub fn as_map(&self) -> Option<&IndexMap<String, Value>>
Sourcepub fn remove_subscription(&mut self, key: &Value)
pub fn remove_subscription(&mut self, key: &Value)
delete client.subscriptions[key]: drops the live client’s entry and
the handle’s snapshot entry (what remove(&mut subscriptions, key) did).
Sourcepub fn add_subscription(&mut self, key: &Value, val: Value)
pub fn add_subscription(&mut self, key: &Value, val: Value)
client.subscriptions[key] = val: writes the live client and the
handle’s snapshot (what add_element_to_object(&mut subscriptions, ..) did).
Sourcepub fn has_subscription(&self, key: &Value) -> bool
pub fn has_subscription(&self, key: &Value) -> bool
key in client.subscriptions, read from the handle’s snapshot.
Sourcepub fn get_subscription(&self, key: &Value) -> Value
pub fn get_subscription(&self, key: &Value) -> Value
client.subscriptions[key] (Null when absent).
Sourcepub fn subscription_keys(&self) -> Vec<Value>
pub fn subscription_keys(&self) -> Vec<Value>
Object.keys(client.subscriptions) (internal tags filtered).
Sourcepub fn has_future(&self, key: &Value) -> bool
pub fn has_future(&self, key: &Value) -> bool
key in client.futures, read from the handle’s snapshot.
Sourcepub fn get_future(&self, key: &Value) -> Value
pub fn get_future(&self, key: &Value) -> Value
client.futures[key] (Null when absent).
Sourcepub fn future_keys(&self) -> Vec<Value>
pub fn future_keys(&self) -> Vec<Value>
Object.keys(client.futures).
pub fn future(&self, args: &[Value]) -> Value
pub fn reusable_future(&self, msg_hash: Value) -> Value
Trait Implementations§
Source§impl Clone for ClientHandle
impl Clone for ClientHandle
Source§fn clone(&self) -> ClientHandle
fn clone(&self) -> ClientHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more