pub enum OnBound {
Join,
Fail,
}Expand description
What a FoldNode reaching its iteration bound means, when stop_when never
held.
A bare lowercase string on the wire ("join", "fail"), not the adjacently
tagged shape FoldJoin uses: the two variants carry no data and none is
foreseen, so a tag object would be ceremony around a word. Adding a third
variant later stays additive all the same, because an older document simply
omits the field.
Absent means OnBound::Join, which is what every fold written before this
field existed does, so the default is the behavior already shipped rather
than a new one chosen now. Authors reach for OnBound::Fail when the stop
predicate is a REQUIREMENT rather than an early exit: a loop that must reach
a score before its value is worth anything is better off saying so than
handing a caller the best of several passes that all fell short. Data only;
this crate never runs the loop, and the engine reads this field in a later
slice.
Variants§
Join
Reaching the bound joins the passes exactly as stop_when holding
would: the join rule picks the value the node produces. Today’s
behavior, and what an absent field means.
Fail
Reaching the bound without stop_when holding is an error: the loop
converged on nothing, and the node produces no value.
Trait Implementations§
impl Copy for OnBound
Source§impl<'de> Deserialize<'de> for OnBound
impl<'de> Deserialize<'de> for OnBound
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>,
impl Eq for OnBound
Source§impl JsonSchema for OnBound
impl JsonSchema for OnBound
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more