Skip to content

How to use use specta::Type in this crate #1

@songjiachao

Description

@songjiachao

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default, Type)]
pub struct ProxiedRequest {
#[serde(with = "http_serde::method")]
pub method: Method,
#[serde(with = "http_serde::uri")]
pub uri: Uri,
#[serde(with = "http_serde::version")]
pub version: Version,
#[serde(with = "http_serde::header_map")]
pub headers: HeaderMap,
pub body: Option,
pub time: i64,
pub rule: Option,
}

// -> got error

error[E0277]: the trait bound Method: Type is not satisfied
--> /Users/vivo/Desktop/code/fun-family/app/crates/fun-core/src/record.rs:74:17
|
74 | pub method: Method,
| ^^^^^^ the trait Type is not implemented for Method
|
= help: the following other types implement trait Type:
&'a T
&'a [T]
&'a str
()
(T10, T11, T12, T13)
(T11, T12, T13)
(T12, T13)
(T13,)
and 100 others

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions