Skip to main content

LightningClientConfig

Struct LightningClientConfig 

Source
pub struct LightningClientConfig {
    pub connect_timeout: Duration,
    pub idle_timeout: Duration,
    pub keep_alive_interval: Duration,
    pub reconnect_initial_backoff: Duration,
    pub reconnect_max_backoff: Duration,
    pub reconnect_max_retries: u32,
    pub reconnect_slow_probe_interval: Option<Duration>,
    pub max_connections: usize,
    pub max_frame_payload_bytes: usize,
    pub max_stream_payload_bytes: usize,
    pub stream_chunk_timeout: Option<Duration>,
    pub metagraph: Option<MetagraphMonitorConfig>,
}
Expand description

Configuration for LightningClient.

All timeouts use Duration and have sensible defaults via Default.

Fields§

§connect_timeout: Duration

Timeout for QUIC connection establishment and handshake. Default: 10s.

§idle_timeout: Duration

QUIC idle timeout before the connection is closed. Default: 150s.

§keep_alive_interval: Duration

Interval for QUIC keep-alive pings. Default: 30s.

§reconnect_initial_backoff: Duration

Initial backoff delay after a failed reconnection attempt. Default: 1s.

§reconnect_max_backoff: Duration

Maximum backoff delay between reconnection attempts. Default: 60s.

§reconnect_max_retries: u32

Maximum consecutive reconnection attempts before giving up. Default: 5.

§reconnect_slow_probe_interval: Option<Duration>

After fast retries are exhausted, interval between periodic slow probe attempts. Keeps scoring data flowing without wasting resources. None disables slow probing (hard exhaustion, original behavior). Default: 60s.

§max_connections: usize

Maximum number of concurrent QUIC connections. Default: 1024.

§max_frame_payload_bytes: usize

Maximum single-frame payload size in bytes. Default: 64 MiB.

§max_stream_payload_bytes: usize

Aggregate byte limit for collect_all() across all chunks in a streaming response. Defaults to DEFAULT_MAX_FRAME_PAYLOAD (64 MiB). Increase for multi-chunk streams that exceed a single frame. Must be >= max_frame_payload_bytes.

§stream_chunk_timeout: Option<Duration>

Per-chunk read timeout for streaming responses. When set, each next_chunk() call aborts if no data arrives within this duration. Default: None (no timeout).

§metagraph: Option<MetagraphMonitorConfig>

Metagraph monitor configuration. When set, initialize_connections starts a background task that periodically re-syncs the subnet and updates connections.

Implementations§

Trait Implementations§

Source§

impl Clone for LightningClientConfig

Source§

fn clone(&self) -> LightningClientConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for LightningClientConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more