Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using with on inner type parameters #993

Closed
lawliet89 opened this issue Jul 19, 2017 · 2 comments
Closed

Using with on inner type parameters #993

lawliet89 opened this issue Jul 19, 2017 · 2 comments

Comments

@lawliet89
Copy link

lawliet89 commented Jul 19, 2017

Consider the Url struct where the serde implementation is provided by a separate crate url_serde.

If my struct contains a Url to be (de)serialized, I can do:

#[derive(Serialize, Deserialize)]
struct MyStruct {
    #[serde(with = "url_serde")]
    url: Url,
}

But if my struct contains something else like HashMap<Url>, I will have to define a new wrapper type around Url before I can include HashMap<Url> in my struct AFAIK.

Is it even possible for serde to support the with attribute for this inner Url type?

@dtolnay
Copy link
Member

dtolnay commented Jul 19, 2017

This is not supported but we are tracking it in #723. It needs more design work.

@lawliet89
Copy link
Author

Thanks. I guess I wasn't using the right keywords to search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants