use refs in ApiMethod
This commit is contained in:
parent
b90dcc34bb
commit
89feb6acdf
|
@ -5,8 +5,8 @@ use serde_json::{Value};
|
||||||
|
|
||||||
pub struct ApiMethod {
|
pub struct ApiMethod {
|
||||||
pub description: &'static str,
|
pub description: &'static str,
|
||||||
pub properties: StaticPropertyMap,
|
pub properties: &'static StaticPropertyMap,
|
||||||
pub returns: Jss,
|
pub returns: &'static Jss,
|
||||||
pub handler: fn(Value) -> Result<Value, Error>,
|
pub handler: fn(Value) -> Result<Value, Error>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ fn test_api_handler(param: Value) -> Result<Value, Error> {
|
||||||
|
|
||||||
static TEST_API_METHOD: ApiMethod = ApiMethod {
|
static TEST_API_METHOD: ApiMethod = ApiMethod {
|
||||||
description: "This is a simple test.",
|
description: "This is a simple test.",
|
||||||
properties: StaticPropertyMap {
|
properties: &StaticPropertyMap {
|
||||||
entries: &[
|
entries: &[
|
||||||
("force", Boolean!{
|
("force", Boolean!{
|
||||||
optional => Some(true),
|
optional => Some(true),
|
||||||
|
@ -105,7 +105,7 @@ static TEST_API_METHOD: ApiMethod = ApiMethod {
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
returns: Jss::Null,
|
returns: &Jss::Null,
|
||||||
handler: test_api_handler,
|
handler: test_api_handler,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue