forked from proxmox-mirrors/proxmox
api: ApiMethodInfo should be Send + Sync
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
6488a5cddb
commit
22f4d076e2
@ -32,16 +32,16 @@ pub enum SubRoute<Body: 'static> {
|
|||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct Router<Body: 'static> {
|
pub struct Router<Body: 'static> {
|
||||||
/// The `GET` http method.
|
/// The `GET` http method.
|
||||||
pub get: Option<&'static dyn ApiMethodInfo<Body>>,
|
pub get: Option<&'static (dyn ApiMethodInfo<Body> + Send + Sync)>,
|
||||||
|
|
||||||
/// The `PUT` http method.
|
/// The `PUT` http method.
|
||||||
pub put: Option<&'static dyn ApiMethodInfo<Body>>,
|
pub put: Option<&'static (dyn ApiMethodInfo<Body> + Send + Sync)>,
|
||||||
|
|
||||||
/// The `POST` http method.
|
/// The `POST` http method.
|
||||||
pub post: Option<&'static dyn ApiMethodInfo<Body>>,
|
pub post: Option<&'static (dyn ApiMethodInfo<Body> + Send + Sync)>,
|
||||||
|
|
||||||
/// The `DELETE` http method.
|
/// The `DELETE` http method.
|
||||||
pub delete: Option<&'static dyn ApiMethodInfo<Body>>,
|
pub delete: Option<&'static (dyn ApiMethodInfo<Body> + Send + Sync)>,
|
||||||
|
|
||||||
/// Specifies the behavior of sub directories. See [`SubRoute`].
|
/// Specifies the behavior of sub directories. See [`SubRoute`].
|
||||||
pub subroute: Option<SubRoute<Body>>,
|
pub subroute: Option<SubRoute<Body>>,
|
||||||
@ -113,7 +113,7 @@ where
|
|||||||
/// Builder method to provide a `GET` method info.
|
/// Builder method to provide a `GET` method info.
|
||||||
pub fn get<I>(mut self, method: &'static I) -> Self
|
pub fn get<I>(mut self, method: &'static I) -> Self
|
||||||
where
|
where
|
||||||
I: ApiMethodInfo<Body>,
|
I: ApiMethodInfo<Body> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.get = Some(method);
|
self.get = Some(method);
|
||||||
self
|
self
|
||||||
@ -122,7 +122,7 @@ where
|
|||||||
/// Builder method to provide a `PUT` method info.
|
/// Builder method to provide a `PUT` method info.
|
||||||
pub fn put<I>(mut self, method: &'static I) -> Self
|
pub fn put<I>(mut self, method: &'static I) -> Self
|
||||||
where
|
where
|
||||||
I: ApiMethodInfo<Body>,
|
I: ApiMethodInfo<Body> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.put = Some(method);
|
self.put = Some(method);
|
||||||
self
|
self
|
||||||
@ -131,7 +131,7 @@ where
|
|||||||
/// Builder method to provide a `POST` method info.
|
/// Builder method to provide a `POST` method info.
|
||||||
pub fn post<I>(mut self, method: &'static I) -> Self
|
pub fn post<I>(mut self, method: &'static I) -> Self
|
||||||
where
|
where
|
||||||
I: ApiMethodInfo<Body>,
|
I: ApiMethodInfo<Body> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.post = Some(method);
|
self.post = Some(method);
|
||||||
self
|
self
|
||||||
@ -140,7 +140,7 @@ where
|
|||||||
/// Builder method to provide a `DELETE` method info.
|
/// Builder method to provide a `DELETE` method info.
|
||||||
pub fn delete<I>(mut self, method: &'static I) -> Self
|
pub fn delete<I>(mut self, method: &'static I) -> Self
|
||||||
where
|
where
|
||||||
I: ApiMethodInfo<Body>,
|
I: ApiMethodInfo<Body> + Send + Sync,
|
||||||
{
|
{
|
||||||
self.delete = Some(method);
|
self.delete = Some(method);
|
||||||
self
|
self
|
||||||
|
Loading…
Reference in New Issue
Block a user