File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -114,14 +114,29 @@ const REQUEST_ROUTE_PROPERTY_NAME: &str = "request-route";
114
114
const TARGET_MEDIA_TYPE_PROPERTY_NAME : & str = "target-media-type" ;
115
115
116
116
/// Data passed to handlebars templates and executables.
117
+ ///
118
+ /// Fields serialize into kebab-case (e.g. `server_info` becomes `server-info`).
117
119
#[ derive( Clone , Serialize ) ]
118
120
#[ serde( rename_all = "kebab-case" ) ]
119
121
pub struct RenderData < ServerInfo : Clone + Serialize > {
122
+ /// A hierarchial index of the content. This is serialized with the name
123
+ /// `/` (with handlebars escaping this looks like `[/].[foo/].bar`).
120
124
#[ serde( rename = "/" ) ]
121
125
pub index : ContentIndex ,
126
+
127
+ /// Metadata about the server, such as its version.
122
128
pub server_info : ServerInfo ,
129
+
130
+ /// The request [`Route`] that caused this content to be rendered, if any.
123
131
pub request_route : Option < Route > ,
132
+
133
+ /// The best [`MediaType`] as determined by content negotiation. Rendering
134
+ /// must emit content in this media type.
124
135
pub target_media_type : Option < MediaType > ,
136
+
137
+ /// An [HTTP `4xx` or `5xx` status code](https://datatracker.ietf.org/doc/html/rfc7231#section-6)
138
+ /// indicating that something went wrong. This will be set while rendering
139
+ /// content for the `--error-handler-route`.
125
140
pub error_code : Option < u16 > ,
126
141
}
127
142
You can’t perform that action at this time.
0 commit comments