hyperlane-macros 21.12.1

A comprehensive collection of procedural macros for building HTTP servers with enhanced functionality. This crate provides attribute macros that simplify HTTP request handling, protocol validation, response management, and request data extraction.
Documentation
use super::*;

/// Implements the `Parse` trait for `RouteAttr`.
///
/// This implementation defines how to parse a `TokenStream` into a `RouteAttr` struct,
/// extracting the path expression from the input.
impl Parse for RouteAttr {
    /// Parses the input token stream into a RouteAttr structure.
    ///
    /// # Arguments
    ///
    /// - `ParseStream` - The token stream to parse.
    ///
    /// # Returns
    ///
    /// - `Result<Self>` - The parsed RouteAttr, or an error for invalid input.
    fn parse(input: ParseStream) -> Result<Self> {
        let first_expr: Expr = input.parse()?;
        Ok(RouteAttr { path: first_expr })
    }
}