Add generic type to remote derive example
This commit is contained in:
parent
be92d4da5f
commit
e25791dddf
4 changed files with 20 additions and 0 deletions
|
@ -31,6 +31,9 @@ pub struct Process {
|
|||
pub command_line: String,
|
||||
#[serde(with = "DurationDef")]
|
||||
pub wall_time: Duration,
|
||||
// Generic types must be explicitly specified with turbofix `::<>` syntax.
|
||||
#[serde(with = "Vec::<DurationDef>")]
|
||||
pub durations: Vec<Duration>,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -4,12 +4,19 @@
|
|||
"type": "object",
|
||||
"required": [
|
||||
"command_line",
|
||||
"durations",
|
||||
"wall_time"
|
||||
],
|
||||
"properties": {
|
||||
"command_line": {
|
||||
"type": "string"
|
||||
},
|
||||
"durations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
},
|
||||
"wall_time": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
|
|
|
@ -31,6 +31,9 @@ pub struct Process {
|
|||
pub command_line: String,
|
||||
#[serde(with = "DurationDef")]
|
||||
pub wall_time: Duration,
|
||||
// Generic types must be explicitly specified with turbofix `::<>` syntax.
|
||||
#[serde(with = "Vec::<DurationDef>")]
|
||||
pub durations: Vec<Duration>,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -4,12 +4,19 @@
|
|||
"type": "object",
|
||||
"required": [
|
||||
"command_line",
|
||||
"durations",
|
||||
"wall_time"
|
||||
],
|
||||
"properties": {
|
||||
"command_line": {
|
||||
"type": "string"
|
||||
},
|
||||
"durations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
},
|
||||
"wall_time": {
|
||||
"$ref": "#/definitions/Duration"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue