Skip to main content

response_field

Function response_field 

Source
pub fn response_field<T: FromStr + Default>(xml: &str, name: &str) -> T
Expand description

Read a named response argument and parse it, falling back to the type’s default when the argument is absent or unparseable.

This is the exact behavior of the old get_child(..).get_text().parse().ok().unwrap_or_default() chain that every macro-generated parse_response used, kept in one place.