Skip to main content

Crate use_api_param

Crate use_api_param 

Source
Expand description

§use-api-param

API parameter primitives for RustUse.

Models path, query, header, and body parameter names plus location, requirement, and style labels.

§Example

use use_api_param::{ParamLocation, PathParamName};

let value = PathParamName::new("user_id").expect("valid API primitive");

assert_eq!(value.as_str(), "user_id");
assert_eq!(ParamLocation::Path.to_string(), "path");

§Scope

  • Small validated types for API metadata.
  • Stable display labels and conservative parsing helpers.
  • Dependency-light primitives that can be reused by other RustUse crates.

§Non-goals

  • No request parser.
  • No framework binding.
  • No schema validation.

§License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license

Structs§

BodyParamName
HeaderParamName
PathParamName
PrimitiveMetadata
Lightweight metadata tying this crate’s primary text and label together.
QueryParamName

Enums§

ApiPrimitiveError
Error returned when API primitive text or labels are invalid.
ParamLocation
API parameter location labels.
ParamRequirement
API parameter requirement labels.
ParamStyle
API parameter style labels.