#[non_exhaustive]pub struct WebSocketCapability {
pub url: String,
pub supports_push: bool,
pub extra: Map<String, Value>,
}Expand description
The value of the CAPABILITY key in a Session’s
capabilities (RFC 8887 §3).
use jmap_websocket::WebSocketCapability;
let cap = WebSocketCapability::new("wss://server.example.com/jmap/ws/", true);
assert_eq!(
serde_json::to_value(&cap).unwrap(),
serde_json::json!({"url": "wss://server.example.com/jmap/ws/", "supportsPush": true}),
);Unknown members are kept in extra (workspace
extras-preservation policy, AGENTS.md).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.url: Stringurl: the wss-URI of the WebSocket URL endpoint (RFC 6455 §3).
This type does not check the scheme.
supports_push: boolsupportsPush: whether the server sends push notifications over
the WebSocket (RFC 8887 §4.3.5). Required on the wire; a missing
value reads as false.
extra: Map<String, Value>Vendor, site and future-spec members not covered above.
Implementations§
Trait Implementations§
Source§impl Clone for WebSocketCapability
impl Clone for WebSocketCapability
Source§impl Debug for WebSocketCapability
impl Debug for WebSocketCapability
Source§impl<'de> Deserialize<'de> for WebSocketCapability
impl<'de> Deserialize<'de> for WebSocketCapability
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
impl Eq for WebSocketCapability
Source§impl PartialEq for WebSocketCapability
impl PartialEq for WebSocketCapability
Source§impl Serialize for WebSocketCapability
impl Serialize for WebSocketCapability
impl StructuralPartialEq for WebSocketCapability
Auto Trait Implementations§
impl Forget for WebSocketCapability
impl Freeze for WebSocketCapability
impl Move for WebSocketCapability
impl RefUnwindSafe for WebSocketCapability
impl Send for WebSocketCapability
impl Sync for WebSocketCapability
impl Unpin for WebSocketCapability
impl UnsafeUnpin for WebSocketCapability
impl UnwindSafe for WebSocketCapability
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