Skip to main content

is_unknown_property_error

Function is_unknown_property_error 

pub fn is_unknown_property_error(e: &Error, name: &str) -> bool
Expand description

True when e is exactly the “Unknown property” marker produced by the Configurable derive’s set_prop/get_prop fallback (and by prop_name_to_serde_field in this module) for the specific property name the caller just tried. Namespace-sharing nested delegation sites (serde-flatten, Option<T>, dotted-key candidate loops) use it to tell “not one of mine — keep trying siblings” apart from a real value error on a confirmed path.

Both constructors build the error as exactly Unknown property '{name}' via anyhow::Error::msg(String), so the downcast is the common zero-alloc path; to_string() is only a fallback for wrapped/contextualized errors. The comparison is against the full message, not just a prefix: a genuine nested value error whose text happens to start with “Unknown property” (a custom validator message, say) must not be mistaken for this fall-through marker and silently swallowed as a retry.