#[non_exhaustive]pub struct WebSocketOptions<'a> {
pub bearer: Option<&'a str>,
pub max_message_bytes: Option<usize>,
pub policy: Option<&'a TlsPolicy>,
}Available on crate feature
tokio only.Expand description
How to open a WebSocket.
The one setting that is not a URL is the size cap, and it is here because it has to be
applied at the handshake: a frame is fully buffered by the WebSocket library before any
of this crate sees it, so a cap enforced afterwards by codec bounds
what is parsed and not what is held. Left alone it is
DecodeOptions::DEFAULT_MAX_BYTES —
the same mebibyte the codec and the session engines use, so the default configuration
is bounded end to end. Raise both together or neither.
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.bearer: Option<&'a str>The bearer token, which under S2 Connect is the websocketToken.
max_message_bytes: Option<usize>The largest frame the transport will buffer. None is the codec’s own default.
policy: Option<&'a TlsPolicy>Available on crate feature
connect-client only.How to authenticate the server’s certificate. None is the public PKI.
Implementations§
Source§impl<'a> WebSocketOptions<'a>
impl<'a> WebSocketOptions<'a>
Sourcepub const fn max_message_bytes(self, bytes: usize) -> Self
pub const fn max_message_bytes(self, bytes: usize) -> Self
Buffer no frame larger than this.
Trait Implementations§
Source§impl<'a> Clone for WebSocketOptions<'a>
impl<'a> Clone for WebSocketOptions<'a>
Source§fn clone(&self) -> WebSocketOptions<'a>
fn clone(&self) -> WebSocketOptions<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for WebSocketOptions<'a>
impl<'a> Debug for WebSocketOptions<'a>
Source§impl<'a> Default for WebSocketOptions<'a>
impl<'a> Default for WebSocketOptions<'a>
Source§fn default() -> WebSocketOptions<'a>
fn default() -> WebSocketOptions<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for WebSocketOptions<'a>
impl<'a> RefUnwindSafe for WebSocketOptions<'a>
impl<'a> Send for WebSocketOptions<'a>
impl<'a> Sync for WebSocketOptions<'a>
impl<'a> Unpin for WebSocketOptions<'a>
impl<'a> UnsafeUnpin for WebSocketOptions<'a>
impl<'a> UnwindSafe for WebSocketOptions<'a>
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