Skip to main content

assert_derivable_arg_name

Function assert_derivable_arg_name 

Source
pub const fn assert_derivable_arg_name(name: &str)
Expand description

Compile-time guard rejecting request field names whose UPnP element name cannot be derived by capitalizing the first character.

UPnP argument names come from each device’s SCPD and use casing that snake_case does not preserve (object_id -> ObjectID, enqueued_uri -> EnqueuedURI). Capitalizing only the first character would emit <Object_id>, which devices reject. Multi-word request fields must therefore declare their element name via the request_xml_mapping: block; this function makes forgetting a compile error rather than a malformed request discovered at runtime.

§Panics

Panics (at compile time, when used in a const context) if name contains _.