pub struct JsonRpcConnectionOptions {
pub request_timeout: Option<Duration>,
pub outbound_capacity: usize,
pub observer: Option<Arc<dyn CorsaObserver>>,
}Expand description
Runtime policy applied to a JsonRpcConnection.
Fields§
§request_timeout: Option<Duration>Maximum time to wait for a response before surfacing a timeout.
outbound_capacity: usizeMaximum number of queued outbound messages waiting on the writer thread.
observer: Option<Arc<dyn CorsaObserver>>Optional observer for structured transport events.
Implementations§
Source§impl JsonRpcConnectionOptions
impl JsonRpcConnectionOptions
Sourcepub fn new() -> JsonRpcConnectionOptions
pub fn new() -> JsonRpcConnectionOptions
Creates the default production-oriented JSON-RPC transport policy.
Sourcepub fn with_request_timeout(
self,
timeout: Option<Duration>,
) -> JsonRpcConnectionOptions
pub fn with_request_timeout( self, timeout: Option<Duration>, ) -> JsonRpcConnectionOptions
Sets the per-request timeout.
Sourcepub fn with_outbound_capacity(self, capacity: usize) -> JsonRpcConnectionOptions
pub fn with_outbound_capacity(self, capacity: usize) -> JsonRpcConnectionOptions
Sets the maximum number of queued outbound messages.
Sourcepub fn with_observer(
self,
observer: Arc<dyn CorsaObserver>,
) -> JsonRpcConnectionOptions
pub fn with_observer( self, observer: Arc<dyn CorsaObserver>, ) -> JsonRpcConnectionOptions
Sets the observer used for structured transport events.
Sourcepub fn with_observer_if_some(
self,
observer: Option<Arc<dyn CorsaObserver>>,
) -> JsonRpcConnectionOptions
pub fn with_observer_if_some( self, observer: Option<Arc<dyn CorsaObserver>>, ) -> JsonRpcConnectionOptions
Sets the observer when one is available.
Trait Implementations§
Source§impl Clone for JsonRpcConnectionOptions
impl Clone for JsonRpcConnectionOptions
Source§fn clone(&self) -> JsonRpcConnectionOptions
fn clone(&self) -> JsonRpcConnectionOptions
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 Debug for JsonRpcConnectionOptions
impl Debug for JsonRpcConnectionOptions
Source§impl Default for JsonRpcConnectionOptions
impl Default for JsonRpcConnectionOptions
Source§fn default() -> JsonRpcConnectionOptions
fn default() -> JsonRpcConnectionOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for JsonRpcConnectionOptions
impl !RefUnwindSafe for JsonRpcConnectionOptions
impl Send for JsonRpcConnectionOptions
impl Sync for JsonRpcConnectionOptions
impl Unpin for JsonRpcConnectionOptions
impl UnsafeUnpin for JsonRpcConnectionOptions
impl !UnwindSafe for JsonRpcConnectionOptions
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