Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

serde_yaml can't be used with serde-transcode #123

Closed
Mingun opened this issue Dec 31, 2018 · 2 comments
Closed

serde_yaml can't be used with serde-transcode #123

Mingun opened this issue Dec 31, 2018 · 2 comments

Comments

@Mingun
Copy link

Mingun commented Dec 31, 2018

serde-transcode requires instance of Serializer/Deserializer, but in serde_yaml they is private...

@Mingun
Copy link
Author

Mingun commented Dec 31, 2018

However, nevertheless it is possible, but it is unusual. Just instead of

let deserializer = ...;
let serializer   = ...;
serde_transcode::transcode(deserializer, serializer).expect("Transcode failed");

it is necessary to use

let deserializer = ...;
let tc = serde_transcode::Transcoder::new(deserializer);
serde_yaml::to_writer(io::stdout(), &tc).expect("Transcode failed");

It would be quite good to bring to have an opportunity to write everything in the one standard

@dtolnay
Copy link
Owner

dtolnay commented Dec 31, 2018

Thanks! Exposing the Serializer and Deserializer type are tracked in #44. Closing as a duplicate of that issue.

@dtolnay dtolnay closed this as completed Dec 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants