pub struct RouteMetadata {
pub path: String,
pub method: String,
pub protocol: String,
pub description: Option<String>,
pub request_schema: Option<Value>,
pub response_schema: Option<Value>,
}Expand description
Metadata about a registered route
Contains all information needed to generate documentation for a route across different protocols (REST, GraphQL, gRPC).
Fields§
§path: StringThe route path (e.g., “/users”, “/users/{id}”)
method: StringHTTP method for REST routes (e.g., “GET”, “POST”) Empty for non-REST protocols
protocol: StringProtocol this route belongs to (e.g., “rest”, “graphql”, “grpc”)
description: Option<String>Optional description from doc comments
request_schema: Option<Value>Request schema as JSON Schema (if available)
response_schema: Option<Value>Response schema as JSON Schema (if available)
Implementations§
Source§impl RouteMetadata
impl RouteMetadata
Sourcepub fn new(
path: impl Into<String>,
method: impl Into<String>,
protocol: impl Into<String>,
) -> RouteMetadata
pub fn new( path: impl Into<String>, method: impl Into<String>, protocol: impl Into<String>, ) -> RouteMetadata
Create a new RouteMetadata
Sourcepub fn with_description(self, description: impl Into<String>) -> RouteMetadata
pub fn with_description(self, description: impl Into<String>) -> RouteMetadata
Set the description
Sourcepub fn with_request_schema(self, schema: Value) -> RouteMetadata
pub fn with_request_schema(self, schema: Value) -> RouteMetadata
Set the request schema
Sourcepub fn with_response_schema(self, schema: Value) -> RouteMetadata
pub fn with_response_schema(self, schema: Value) -> RouteMetadata
Set the response schema
Trait Implementations§
Source§impl Clone for RouteMetadata
impl Clone for RouteMetadata
Source§fn clone(&self) -> RouteMetadata
fn clone(&self) -> RouteMetadata
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RouteMetadata
impl Debug for RouteMetadata
Source§impl<'de> Deserialize<'de> for RouteMetadata
impl<'de> Deserialize<'de> for RouteMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RouteMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RouteMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RouteMetadata
impl PartialEq for RouteMetadata
Source§impl Serialize for RouteMetadata
impl Serialize for RouteMetadata
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for RouteMetadata
Auto Trait Implementations§
impl Freeze for RouteMetadata
impl RefUnwindSafe for RouteMetadata
impl Send for RouteMetadata
impl Sync for RouteMetadata
impl Unpin for RouteMetadata
impl UnwindSafe for RouteMetadata
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)