pub struct ServeEconomicsConfig {
pub policy: Option<String>,
pub discount: Option<f64>,
pub n_max: Option<u32>,
pub warming_budget: Option<u64>,
pub warming_refill: Option<u64>,
}Expand description
Refuse-to-serve economics tuning knobs (ADR 041). See
CacheConfig::serve_economics.
Fields§
§policy: Option<String>Refuse-to-serve policy selector. "off" or "margin". Absent =>
crate::config::DEFAULT_SERVE_ECONOMICS_POLICY ("margin"). An
unrecognized name is rejected at config load rather than silently
falling back.
discount: Option<f64>Discount applied to the sell price when deciding whether a
speculative pull clears its margin gate. Within (0.0, 1.0]. Absent
=> crate::config::DEFAULT_SERVE_ECONOMICS_DISCOUNT_BPS (5000,
i.e. 0.5).
n_max: Option<u32>Maximum number of concurrent speculative-warming sources. >= 1.
Absent => crate::config::DEFAULT_SERVE_ECONOMICS_N_MAX (64).
warming_budget: Option<u64>Per-source speculative-warming allowance, in payment base units.
> 0. Absent =>
crate::config::DEFAULT_SERVE_ECONOMICS_WARMING_BUDGET
(5,000,000).
warming_refill: Option<u64>Per-source allowance refill rate, in payment base units per second.
>= 0; 0 disables time-based refill (allowance only resets on
restart or via the serve-vindicated upgrade). Absent =>
crate::config::DEFAULT_SERVE_ECONOMICS_WARMING_REFILL (58).
Trait Implementations§
Source§impl Debug for ServeEconomicsConfig
impl Debug for ServeEconomicsConfig
Source§impl Default for ServeEconomicsConfig
impl Default for ServeEconomicsConfig
Source§impl<'de> Deserialize<'de> for ServeEconomicsConfig
impl<'de> Deserialize<'de> for ServeEconomicsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ServeEconomicsConfig
impl RefUnwindSafe for ServeEconomicsConfig
impl Send for ServeEconomicsConfig
impl Sync for ServeEconomicsConfig
impl Unpin for ServeEconomicsConfig
impl UnsafeUnpin for ServeEconomicsConfig
impl UnwindSafe for ServeEconomicsConfig
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more