pub struct BoundTask {
pub lower_bound: Option<OracleJob>,
pub lower_bound_value: Option<String>,
pub upper_bound: Option<OracleJob>,
pub upper_bound_value: Option<String>,
pub on_exceeds_upper_bound: Option<OracleJob>,
pub on_exceeds_upper_bound_value: Option<String>,
pub on_exceeds_lower_bound: Option<OracleJob>,
pub on_exceeds_lower_bound_value: Option<String>,
}
Expand description
Bound the running result to an upper/lower bound. This is typically the last task in an OracleJob.
Input: The current running numerical result.
Returns: The running result bounded to an upper or lower bound if it exceeds a given threshold.
Example: Bound the running result to a value between 0.90 and 1.10
{ "boundTask": { "lowerBoundValue": "0.90","onExceedsLowerBoundValue": "0.90","upperBoundValue": "1.10","onExceedsUpperBoundValue": "1.10" } }
Fields§
§lower_bound: Option<OracleJob>
/ The OracleJob to execute for the lower bound value.
lower_bound_value: Option<String>
/ The value to use for the lower bound. Can be set to a ${CACHE_KEY}
.
upper_bound: Option<OracleJob>
/ The OracleJob to execute for the upper bound value.
upper_bound_value: Option<String>
/ The value to use for the upper bound. Can be set to a ${CACHE_KEY}
.
on_exceeds_upper_bound: Option<OracleJob>
/ The OracleJob to execute if the upper bound is exceeded.
on_exceeds_upper_bound_value: Option<String>
/ The value to use if the upper bound is exceeded. Can be set to a ${CACHE_KEY}
.
on_exceeds_lower_bound: Option<OracleJob>
/ The OracleJob to execute if the lower bound is exceeded.
on_exceeds_lower_bound_value: Option<String>
/ The value to use if the lower bound is exceeded. Can be set to a ${CACHE_KEY}
.
Implementations§
Source§impl BoundTask
impl BoundTask
Sourcepub fn lower_bound_value(&self) -> &str
pub fn lower_bound_value(&self) -> &str
Returns the value of lower_bound_value
, or the default value if lower_bound_value
is unset.
Sourcepub fn upper_bound_value(&self) -> &str
pub fn upper_bound_value(&self) -> &str
Returns the value of upper_bound_value
, or the default value if upper_bound_value
is unset.
Sourcepub fn on_exceeds_upper_bound_value(&self) -> &str
pub fn on_exceeds_upper_bound_value(&self) -> &str
Returns the value of on_exceeds_upper_bound_value
, or the default value if on_exceeds_upper_bound_value
is unset.
Sourcepub fn on_exceeds_lower_bound_value(&self) -> &str
pub fn on_exceeds_lower_bound_value(&self) -> &str
Returns the value of on_exceeds_lower_bound_value
, or the default value if on_exceeds_lower_bound_value
is unset.
Trait Implementations§
Source§impl Message for BoundTask
impl Message for BoundTask
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.