serde-rs / serde-rs.github.io Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://serde.rs
License: Creative Commons Attribution Share Alike 4.0 International
Home Page: https://serde.rs
License: Creative Commons Attribution Share Alike 4.0 International
https://www.reddit.com/r/programming/comments/5jsetj/announcing_rust_114/dbj4gn0/
That show doesn't work very well on mobile; the sidebar takes up most of the screen by default. Perhaps it could be collapsed by default?
I think this is a consequence of the workaround for #28. Maybe a better heuristic should be:
I don't know CSS or JavaScript so let me know if anyone has a better plan.
<sarnold> what do you think about calling out Cow<> in https://serde.rs/borrow.html as the solution to this issue? it's in there, but not really pointed out as magical :)
They are compiled separately and the #![feature(proc_macro)] from main.rs has no effect on lib.rs and vice versa.
Should contain an explanation of reasonable default behavior for JSON-like formats.
I want to know what people are looking at and where they are coming from, just like GitHub gives you for repos.
This is what seems to fit without horizontal scrolling in all the browsers I tried.
Not all of these need to be individual sections, for example seq and map are very similar. But we definitely need an explanation of the different types of struct along with examples of how various formats treat them distinctly.
On this page. They are just a performance optimization to avoid allocating a String for recognized fields. You can use String instead.
This may already be recorded, but from a quick read through, I was unable to find it.
Since rust-lang/rust#42588, Rust warns by default on unused extern crates. The example on the homepage, as well as possibly other examples on the website, has extern crate serde
but does not refer to anything from it. It is there as a reminder that the generated code requires serde to be listed as a dependency in Cargo.toml.
I imagine we can make up for it by providing an explicit Cargo.toml snippet instead.
[dependencies]
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
This is my favorite example: linked-hash-map/tests/serde.rs
Basically ported from the Serde readme. I would also like some more detail about possible applications of each attribute, with links to relevant example code. For example the field attribute rename
would mention serializing field names as camelCase and serializing fields with names that are reserved Rust keywords.
Really helpful advice from @ssokolow on reddit:
I don't have time to work on it, but here's a quick introduction to CSS media queries, which allow you to assign different CSS rules to different viewport sizes.
https://css-tricks.com/css-media-queries/
(Optionally in concert with the CSS page-break properties, media queries also allow you to make your pages print beautifully... for example, by hiding all elements that only exist to be interacted with and replacing colour cues with other formatting.)
They're supported on all browsers with market share visible in caniuse.com's "Usage relative" mode except IE8, which is estimated to have a 0.42% global market share.
Unfortunately, support for interaction media features is not currently present in Firefox, 4.x versions of the default Android browser, or IE, so any rule you write to inflate your buttons in the presence of coarse
(touch/kinect/wii) input will only apply on about 2/3rds of the browsers out there (desktop browsers included in that count).
For now, if you want to inflate your buttons for easy touch, I'd consider using interactions queries for iOS/Opera/Chrome devices and then using resolution queries (with the dpi
unit for maximum compatibility) and
ed together with a query for a small screen size (to exclude Retina/HiDPI desktop/laptop screens) as a fallback to catch things like Firefox Mobile on smartphones.
https://play.integer32.com/ has been updated to Serde 1.0 so some of the old links may not compile any more.
Currently I need to update both the markdown source and the generated html. I should be able to push changes to markdown and have GitHub Actions push a commit containing built html.
Implemented in serde-rs/serde#817.
In https://serde.rs/borrow.html. Cow is mentioned in the example code but let's explain why you would want to use it, especially in formats that have escape sequences.
Useful for serde-rs/serde#643 but not documented on serde.rs.
These are now fully supported by the data model on sufficiently new compilers.
As reported in serde-rs/serde#1162, the Serialize enum as number example does not work so well if there is a mix of positive and negative enum values. Let's show the more complicated case to be maximally general.
Should contain an explanation of reasonable default behavior for JSON-like formats.
The features page should recommend having your own std
feature if you depend on no_std Serde.
[features]
std = ["serde/std"]
Thanks @tomprice! #47 (comment)
This sometimes happens even though you have #[derive(Deserialize)]
on the right type if there are two version of serde involved. Add an explanation of what it means and how to fix it.
Came up in serde-rs/serde#573.
Put a copy of the gitbook at https://serde.rs/future so we can start pushing documentation of planned breaking changes.
@locallycompact had this use case:
assets/test-stratum.morph:
- repo: http://example.com/repo.git
ref: aaaaaa
bit: assets/test-bit.bit
assets/test-bit.bit:
configureCommands:
- "foodedoo"
buildCommands:
- "ladida"
installCommands:
- "dooopdedoop"
One file contains the path to another file. We can use deserialize_with to inline the contents of the second file into a struct representing the first.
https://serde.rs/transcode.html is still using:
Transcoder::new(&mut deserializer).serialize(&mut serializer)
I think there is a better way now.
When deriving Deserialize, it should be ensured that invariants of the types cannot be violated by deserializing untrusted data. This is especially important if the invariants are trusted by unsafe
code.
I checked but couldn't find such a note in the docs currently.
Makes it seem like we have practically no documentation. Possibly mdBook would not have this problem (#17).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.