allow async api methods to return Response<Bytes>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
3f7e4c0eda
commit
dcfa3ca9a2
@ -196,7 +196,6 @@ fn handle_function(
|
||||
|
||||
if item.asyncness.is_some() {
|
||||
// An async function is expected to return its value, so we wrap it a bit:
|
||||
|
||||
body.push(quote! {
|
||||
// Our helper type derefs to a wrapper performing input validation and returning a
|
||||
// Pin<Box<Future>>.
|
||||
|
@ -317,6 +317,9 @@ unconstrained_api_type! {&str}
|
||||
unconstrained_api_type! {String, isize, usize, i64, u64, i32, u32, i16, u16, i8, u8, f64, f32}
|
||||
unconstrained_api_type! {Vec<String>}
|
||||
|
||||
// Raw return types are also okay:
|
||||
unconstrained_api_type! {Response<Bytes>}
|
||||
|
||||
// FIXME: make const once feature(const_fn) is stable!
|
||||
pub fn get_type_info<T: ApiType>() -> &'static TypeInfo {
|
||||
T::type_info()
|
||||
|
Loading…
Reference in New Issue
Block a user