| |
pub outbound: LimitRateOutbound,
|
| |
}
|
| |
|
| + |
/// Network scheduling limits.
|
| + |
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
| + |
#[serde(default, rename_all = "camelCase")]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct NetworkLimits {
|
| + |
/// How often to run the "idle" task.
|
| + |
pub idle_interval: LimitIdleInterval,
|
| + |
/// How often to run the "gossip" task.
|
| + |
pub gossip_interval: LimitGossipInterval,
|
| + |
/// How often to run the "sync" task.
|
| + |
pub sync_interval: LimitSyncInterval,
|
| + |
/// How often to run the "announce" task.
|
| + |
pub announce_interval: LimitAnnounceInterval,
|
| + |
/// How often to run the "prune" task.
|
| + |
pub prune_interval: LimitPruneInterval,
|
| + |
/// How long before a keep-alive ping is sent.
|
| + |
pub keep_alive_delta: LimitKeepAliveDelta,
|
| + |
/// Fetch timeout, in seconds.
|
| + |
pub fetch_timeout_secs: LimitFetchTimeoutSecs,
|
| + |
/// Target number of outbound peers.
|
| + |
pub target_outbound_peers: TargetOutboundPeers,
|
| + |
/// Minimum amount of time to wait before reconnecting to a peer.
|
| + |
pub min_reconnection_delta: LimitMinReconnectionDelta,
|
| + |
/// Maximum amount of time to wait before reconnecting to a peer.
|
| + |
pub max_reconnection_delta: LimitMaxReconnectionDelta,
|
| + |
/// Connection retry delta used for peers that failed to connect previously.
|
| + |
pub connection_retry_delta: LimitConnectionRetryDelta,
|
| + |
}
|
| + |
|
| |
/// Full address used to connect to a remote node.
|
| |
#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
| |
#[cfg_attr(
|
| |
}
|
| |
}
|
| |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitIdleInterval(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitIdleInterval {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_secs(30))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitIdleInterval> for LocalDuration {
|
| + |
fn from(value: LimitIdleInterval) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitIdleInterval {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitGossipInterval(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitGossipInterval {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_secs(6))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitGossipInterval> for LocalDuration {
|
| + |
fn from(value: LimitGossipInterval) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitGossipInterval {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitSyncInterval(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitSyncInterval {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_secs(60))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitSyncInterval> for LocalDuration {
|
| + |
fn from(value: LimitSyncInterval) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitSyncInterval {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitAnnounceInterval(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitAnnounceInterval {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_mins(60))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitAnnounceInterval> for LocalDuration {
|
| + |
fn from(value: LimitAnnounceInterval) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitAnnounceInterval {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitPruneInterval(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitPruneInterval {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_mins(30))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitPruneInterval> for LocalDuration {
|
| + |
fn from(value: LimitPruneInterval) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitPruneInterval {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitKeepAliveDelta(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitKeepAliveDelta {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_mins(1))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitKeepAliveDelta> for LocalDuration {
|
| + |
fn from(value: LimitKeepAliveDelta) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitKeepAliveDelta {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitMinReconnectionDelta(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitMinReconnectionDelta {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_secs(3))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitMinReconnectionDelta> for LocalDuration {
|
| + |
fn from(value: LimitMinReconnectionDelta) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitMinReconnectionDelta {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitMaxReconnectionDelta(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitMaxReconnectionDelta {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_mins(60))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitMaxReconnectionDelta> for LocalDuration {
|
| + |
fn from(value: LimitMaxReconnectionDelta) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitMaxReconnectionDelta {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| + |
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
| + |
#[serde(transparent)]
|
| + |
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
| + |
pub struct LimitConnectionRetryDelta(localtime::LocalDuration);
|
| + |
|
| + |
impl Default for LimitConnectionRetryDelta {
|
| + |
fn default() -> Self {
|
| + |
Self(localtime::LocalDuration::from_mins(10))
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LimitConnectionRetryDelta> for LocalDuration {
|
| + |
fn from(value: LimitConnectionRetryDelta) -> Self {
|
| + |
value.0
|
| + |
}
|
| + |
}
|
| + |
|
| + |
impl From<LocalDuration> for LimitConnectionRetryDelta {
|
| + |
fn from(value: LocalDuration) -> Self {
|
| + |
Self(value)
|
| + |
}
|
| + |
}
|
| + |
|
| |
/// Create a new type (`$name`) around a given type (`$type`), with a provided
|
| |
/// default (`$default`).
|
| |
///
|