Skip to main content

parse_delay_spec_value

Function parse_delay_spec_value 

Source
pub fn parse_delay_spec_value(v: &Value) -> Result<DelaySpec, String>
Expand description

Parse a YAML/JSON value into a DelaySpec.

Accepted:

  • non-empty string → Before(<string>)
  • object with before and/or after keys → BeforeAfter

Rejected (descriptive error):

  • empty string
  • empty object
  • object with unknown keys
  • object whose before / after values aren’t strings
  • null, arrays, numbers, booleans

Public for unit tests + smoke validation.