pub enum AddChainConfigJsonRpc {
Disabled,
Enabled {
max_pending_requests: NonZero<u32>,
max_subscriptions: u32,
},
}
Expand description
Variants§
Disabled
No JSON-RPC endpoint is available for this chain. This saves up a lot of resources, but will cause all JSON-RPC requests targeting this chain to fail.
Enabled
The JSON-RPC endpoint is enabled. Normal operations.
Fields
max_pending_requests: NonZero<u32>
Maximum number of JSON-RPC requests that can be added to a queue if it is not ready to be processed immediately. Any additional request will be immediately rejected.
This parameter is necessary in order to prevent JSON-RPC clients from using up too
much memory within the client.
If the JSON-RPC client is entirely trusted, then passing u32::MAX
is
completely reasonable.
A typical value is 128.
max_subscriptions: u32
Maximum number of active subscriptions that can be started through JSON-RPC functions. Any request that causes the JSON-RPC server to generate notifications counts as a subscription. Any additional subscription over this limit will be immediately rejected.
This parameter is necessary in order to prevent JSON-RPC clients from using up too
much memory within the client.
If the JSON-RPC client is entirely trusted, then passing u32::MAX
is
completely reasonable.
While a typical reasonable value would be for example 64, existing UIs tend to start a lot of subscriptions, and a value such as 1024 is recommended.
Trait Implementations§
source§impl Clone for AddChainConfigJsonRpc
impl Clone for AddChainConfigJsonRpc
source§fn clone(&self) -> AddChainConfigJsonRpc
fn clone(&self) -> AddChainConfigJsonRpc
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for AddChainConfigJsonRpc
impl RefUnwindSafe for AddChainConfigJsonRpc
impl Send for AddChainConfigJsonRpc
impl Sync for AddChainConfigJsonRpc
impl Unpin for AddChainConfigJsonRpc
impl UnwindSafe for AddChainConfigJsonRpc
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more