#[non_exhaustive]pub struct ConnectionConfig { /* private fields */ }Available on crate feature
server only.Expand description
Per-connection limits and policies.
Set the limits to the values the Session’s
urn:ietf:params:jmap:core capability advertises (RFC 8620 §2).
use jmap_websocket::server::ConnectionConfig;
let config = ConnectionConfig::default()
.max_calls_in_request(32)
.max_size_request(Some(10_000_000))
.max_concurrent_requests(4);
assert_eq!(config.max_calls_in_request_value(), 32);Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn max_calls_in_request(self, max: usize) -> Self
pub fn max_calls_in_request(self, max: usize) -> Self
maxCallsInRequest: a Request with more method calls gets a
limit error naming it.
Sourcepub fn max_size_request(self, max: Option<usize>) -> Self
pub fn max_size_request(self, max: Option<usize>) -> Self
maxSizeRequest in octets, or None for no check here: a longer
text message gets a limit error naming it, unparsed, so with
requestId: null. Also cap the message size in the WebSocket
library, which reads the whole message before the driver sees it.
Sourcepub fn max_concurrent_requests(self, max: usize) -> Self
pub fn max_concurrent_requests(self, max: usize) -> Self
maxConcurrentRequests on this connection. Values below 1 are
treated as 1.
Sourcepub fn binary_frames(self, policy: BinaryFrames) -> Self
pub fn binary_frames(self, policy: BinaryFrames) -> Self
The binary-message policy.
Sourcepub fn max_calls_in_request_value(&self) -> usize
pub fn max_calls_in_request_value(&self) -> usize
The maxCallsInRequest limit.
Sourcepub fn max_size_request_value(&self) -> Option<usize>
pub fn max_size_request_value(&self) -> Option<usize>
The maxSizeRequest limit.
Sourcepub fn max_concurrent_requests_value(&self) -> usize
pub fn max_concurrent_requests_value(&self) -> usize
The per-connection maxConcurrentRequests limit.
Sourcepub fn binary_frames_value(&self) -> BinaryFrames
pub fn binary_frames_value(&self) -> BinaryFrames
The binary-message policy.
Trait Implementations§
Source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
Source§impl Debug for ConnectionConfig
impl Debug for ConnectionConfig
Source§impl Default for ConnectionConfig
impl Default for ConnectionConfig
impl Eq for ConnectionConfig
Source§impl PartialEq for ConnectionConfig
impl PartialEq for ConnectionConfig
impl StructuralPartialEq for ConnectionConfig
Auto Trait Implementations§
impl Forget for ConnectionConfig
impl Freeze for ConnectionConfig
impl Move for ConnectionConfig
impl RefUnwindSafe for ConnectionConfig
impl Send for ConnectionConfig
impl Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl UnsafeUnpin for ConnectionConfig
impl UnwindSafe for ConnectionConfig
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