pub struct PriceGuardConfig { /* private fields */ }Expand description
Per-request price guard configuration.
All fields are optional. When None, struct defaults are used.
Implementations§
Source§impl PriceGuardConfig
impl PriceGuardConfig
Sourcepub fn with_lower_tolerance_bps(self, bps: u32) -> Self
pub fn with_lower_tolerance_bps(self, bps: u32) -> Self
Set the lower tolerance in basis points.
Sourcepub fn with_upper_tolerance_bps(self, bps: u32) -> Self
pub fn with_upper_tolerance_bps(self, bps: u32) -> Self
Set the upper tolerance in basis points.
Sourcepub fn with_fail_on_provider_error(self, fail: bool) -> Self
pub fn with_fail_on_provider_error(self, fail: bool) -> Self
Set whether to reject solutions when providers error.
Sourcepub fn with_fail_on_token_price_not_found(self, fail: bool) -> Self
pub fn with_fail_on_token_price_not_found(self, fail: bool) -> Self
Set whether to reject solutions when no provider returns price for token pair.
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Set whether price guard validation is enabled.
Sourcepub fn lower_tolerance_bps(&self) -> Option<u32>
pub fn lower_tolerance_bps(&self) -> Option<u32>
Lower tolerance in basis points, if set.
Sourcepub fn upper_tolerance_bps(&self) -> Option<u32>
pub fn upper_tolerance_bps(&self) -> Option<u32>
Upper tolerance in basis points, if set.
Sourcepub fn fail_on_provider_error(&self) -> Option<bool>
pub fn fail_on_provider_error(&self) -> Option<bool>
Whether to fail on provider error, if set.
Sourcepub fn fail_on_token_price_not_found(&self) -> Option<bool>
pub fn fail_on_token_price_not_found(&self) -> Option<bool>
Whether to fail on token not found, if set.
Trait Implementations§
Source§impl Clone for PriceGuardConfig
impl Clone for PriceGuardConfig
Source§fn clone(&self) -> PriceGuardConfig
fn clone(&self) -> PriceGuardConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriceGuardConfig
impl Debug for PriceGuardConfig
Source§impl Default for PriceGuardConfig
impl Default for PriceGuardConfig
Source§fn default() -> PriceGuardConfig
fn default() -> PriceGuardConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PriceGuardConfig
impl<'de> Deserialize<'de> for PriceGuardConfig
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 PriceGuardConfig
impl RefUnwindSafe for PriceGuardConfig
impl Send for PriceGuardConfig
impl Sync for PriceGuardConfig
impl Unpin for PriceGuardConfig
impl UnsafeUnpin for PriceGuardConfig
impl UnwindSafe for PriceGuardConfig
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