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: DurationTimeout for QUIC connection establishment and handshake. Default: 10s.
idle_timeout: DurationQUIC idle timeout before the connection is closed. Default: 150s.
keep_alive_interval: DurationInterval for QUIC keep-alive pings. Default: 30s.
reconnect_initial_backoff: DurationInitial backoff delay after a failed reconnection attempt. Default: 1s.
reconnect_max_backoff: DurationMaximum backoff delay between reconnection attempts. Default: 60s.
reconnect_max_retries: u32Maximum 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: usizeMaximum number of concurrent QUIC connections. Default: 1024.
max_frame_payload_bytes: usizeMaximum single-frame payload size in bytes. Default: 64 MiB.
max_stream_payload_bytes: usizeAggregate 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§
Source§impl LightningClientConfig
impl LightningClientConfig
pub fn builder() -> LightningClientConfigBuilder
Trait Implementations§
Source§impl Clone for LightningClientConfig
impl Clone for LightningClientConfig
Source§fn clone(&self) -> LightningClientConfig
fn clone(&self) -> LightningClientConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for LightningClientConfig
impl RefUnwindSafe for LightningClientConfig
impl Send for LightningClientConfig
impl Sync for LightningClientConfig
impl Unpin for LightningClientConfig
impl UnsafeUnpin for LightningClientConfig
impl UnwindSafe for LightningClientConfig
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 moreSource§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
impl<T> JsonSchemaMaybe for T
impl<T> MaybeRefUnwindSafe for Twhere
T: RefUnwindSafe,
impl<T> MaybeSend for Twhere
T: Send,
Source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.