pub struct PriceGuardConfig { /* private fields */ }Expand description
Per-request price guard configuration.
All fields are optional. When None, struct defaults are used.
Re-exported from fynd-rpc-types for wire compatibility.
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) -> PriceGuardConfig
pub fn with_lower_tolerance_bps(self, bps: u32) -> PriceGuardConfig
Set the lower tolerance in basis points.
Sourcepub fn with_upper_tolerance_bps(self, bps: u32) -> PriceGuardConfig
pub fn with_upper_tolerance_bps(self, bps: u32) -> PriceGuardConfig
Set the upper tolerance in basis points.
Sourcepub fn with_fail_on_provider_error(self, fail: bool) -> PriceGuardConfig
pub fn with_fail_on_provider_error(self, fail: bool) -> PriceGuardConfig
Set whether to reject solutions when providers error.
Sourcepub fn with_fail_on_token_price_not_found(self, fail: bool) -> PriceGuardConfig
pub fn with_fail_on_token_price_not_found(self, fail: bool) -> PriceGuardConfig
Set whether to reject solutions when no provider returns price for token pair.
Sourcepub fn with_enabled(self, enabled: bool) -> PriceGuardConfig
pub fn with_enabled(self, enabled: bool) -> PriceGuardConfig
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<PriceGuardConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PriceGuardConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PriceGuardConfig
impl Serialize for PriceGuardConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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
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>
Converts
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>
Converts
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