pub struct ReserveConfig {
pub fuel_usd: f64,
pub window_hours: u64,
}Expand description
A bound on what the whole factory may spend, across every itinerary.
Fuel bounds one chain. This bounds the factory, which is a different question: a scheduled
pipeline mints a fresh itinerary — and a fresh Fuel budget — on every tick, so every chain can
stay inside its rail while the total runs away. See crate::cost::reserve.
Fields§
§fuel_usd: f64Ceiling for the window, in US dollars. Zero means unlimited.
window_hours: u64How far back the rolling window reaches.
Rolling rather than per calendar day, deliberately: a daily bucket can be spent twice across midnight, and needs a timezone to decide when midnight is.
Implementations§
Source§impl ReserveConfig
impl ReserveConfig
Sourcepub fn to_reserve(&self) -> Reserve
pub fn to_reserve(&self) -> Reserve
Builds the runtime Reserve this configuration describes.
Sourcepub fn is_unlimited(&self) -> bool
pub fn is_unlimited(&self) -> bool
Returns true when no ceiling is enforced.
Trait Implementations§
Source§impl Clone for ReserveConfig
impl Clone for ReserveConfig
Source§impl Debug for ReserveConfig
impl Debug for ReserveConfig
Source§impl Default for ReserveConfig
impl Default for ReserveConfig
Source§impl<'de> Deserialize<'de> for ReserveConfig
impl<'de> Deserialize<'de> for ReserveConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ReserveConfig
impl RefUnwindSafe for ReserveConfig
impl Send for ReserveConfig
impl Sync for ReserveConfig
impl Unpin for ReserveConfig
impl UnsafeUnpin for ReserveConfig
impl UnwindSafe for ReserveConfig
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
Mutably borrows from an owned value. Read more