Closed andrewgazelka closed 2 years ago
It's intentional that yaml_rust
is not exposed in the public API of this crate. I have not been happy with that library and I will be replacing it with a different yaml backend.
@dtolnay Do you have any backends in mind? If you are looking for a new backend similar in style to https://github.com/serde-rs/json/blob/master/src/de.rs, I might try implementing one. Ideally, I think the YAML lib should be able to Serialize comments without a full reparse, but I am not sure how you think this should (or even if it should) be done.
It would be beneficial to expose
yaml_rust::Yaml
in some way (perhaps makingSerializerToYaml
public?). I want to add a commenting extension on top ofserde-yaml
—perhapscomment-yaml
—which takesserde-yaml
output and adds comments on top of it. However, the YAML representation provided byserde-yaml
is insufficient as it does not include comments or a means of writing to a String.Currently, I'd have to have a full reparse
struct: Serialize + Comment
(Serialize) -> String
(&string) -> yaml_rust::Yaml
(Comment, yaml_rust::Yaml) -> [String or similar]
Ideally, I'd be able to have:
struct: Serialize + Comment
(Serialize) -> yaml_rust::Yaml
(Comment, yaml_rust::Yaml) -> [String or similar]
where
Comment
is likeSerialize
but for comments.