feat(axum): build forms from checked handles
Add InteractionForm::for_handle so tests and public integration code can construct dispatched forms from generated Handle<T> values instead of raw numeric handle ids. req: ceremony/004 req: public_api/001
This commit is contained in:
@@ -159,6 +159,10 @@ impl InteractionForm {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn for_handle<I>(handle: Handle<I>, fields: impl IntoIterator<Item = (String, String)>) -> Self {
|
||||
Self::new(handle.id().id, fields)
|
||||
}
|
||||
|
||||
pub fn parse_urlencoded(body: &[u8]) -> Result<Self, InteractionFormRejection> {
|
||||
Self::from_parts(parse_urlencoded_pairs(body)?, Vec::new())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user