about summary refs log tree commit diff
path: root/src/libserialize/serialize.rs
AgeCommit message (Collapse)AuthorLines
2014-10-02serialize: remove proxy impls for Gc<T>.Eduard Burtescu-13/+0
2014-09-23use emit_tuple_arg while serializing tuplesDan Burkert-1/+1
2014-08-30Unify non-snake-case lints and non-uppercase statics lintsP1start-2/+2
This unifies the `non_snake_case_functions` and `uppercase_variables` lints into one lint, `non_snake_case`. It also now checks for non-snake-case modules. This also extends the non-camel-case types lint to check type parameters, and merges the `non_uppercase_pattern_statics` lint into the `non_uppercase_statics` lint. Because the `uppercase_variables` lint is now part of the `non_snake_case` lint, all non-snake-case variables that start with lowercase characters (such as `fooBar`) will now trigger the `non_snake_case` lint. New code should be updated to use the new `non_snake_case` lint instead of the previous `non_snake_case_functions` and `uppercase_variables` lints. All use of the `non_uppercase_pattern_statics` should be replaced with the `non_uppercase_statics` lint. Any code that previously contained non-snake-case module or variable names should be updated to use snake case names or disable the `non_snake_case` lint. Any code with non-camel-case type parameters should be changed to use camel case or disable the `non_camel_case_types` lint. [breaking-change]
2014-08-10remove outdated commentChuck Ries-2/+0
These are already coded as traits.
2014-07-31libserialize: add `error()` to `Decoder`Andrew Poelstra-0/+3
A quick and dirty fix for #15036 until we get serious decoder reform. Right now it is impossible for a Decodable to signal a decode error, for example if it has only finitely many allowed values, is a string which must be encoded a certain way, needs a valid checksum, etc. For example in the libuuid implementation of Decodable an Option is unwrapped, meaning that a decode of a malformed UUID will cause the task to fail. Since this adds a method to the `Decoder` trait, all users will need to update their implementations to add it. The strategy used for the current implementations for JSON and EBML is to add a new entry to the error enum `ApplicationError(String)` which stores the string provided to `.error()`. [breaking-change]
2014-07-07Implemented Decodable/Encodable for Cell and RefCell. Fixes #15395mitchmindtree-0/+30
Updated PR with fixme and test Updated PR with fixme and test
2014-06-14rustc: Obsolete the `@` syntax entirelyAlex Crichton-1/+1
This removes all remnants of `@` pointers from rustc. Additionally, this removes the `GC` structure from the prelude as it seems odd exporting an experimental type in the prelude by default. Closes #14193 [breaking-change]
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-26/+0
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-06-11rustc: Update how Gc<T> is recognizedAlex Crichton-4/+5
This commit uses the same trick as ~/Box to map Gc<T> to @T internally inside the compiler. This moves a number of implementations of traits to the `gc` module in the standard library. This removes functions such as `Gc::new`, `Gc::borrow`, and `Gc::ptr_eq` in favor of the more modern equivalents, `box(GC)`, `Deref`, and pointer equality. The Gc pointer itself should be much more useful now, and subsequent commits will move the compiler away from @T towards Gc<T> [breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-5/+5
[breaking-change]
2014-05-24Removed unnecessary macro declarationAdolfo Ochagavía-4/+0
2014-05-16libserialize: Remove all uses of `~str` from `libserialize`.Patrick Walton-14/+2
Had to make `struct Tm` in `libtime` not serializable for now.
2014-05-08Restore Decodable impl for ~[T]Kevin Ballard-0/+15
Bring back the Decodable impl for ~[T], this time using FromVec. It's still not recommended that anyone use this, but at least it's available if necessary.
2014-05-08Handle fallout in libserializeKevin Ballard-18/+5
API Changes: - from_base64() returns Result<Vec<u8>, FromBase64Error> - from_hex() returns Result<Vec<u8>, FromHexError> - json::List is a Vec<Json> - Decodable is no longer implemented on ~[T] (but Encodable still is) - DecoderHelpers::read_to_vec() returns a Result<Vec<T>, E>
2014-05-06librustc: Remove `~EXPR`, `~TYPE`, and `~PAT` from the language, exceptPatrick Walton-3/+3
for `~str`/`~[]`. Note that `~self` still remains, since I forgot to add support for `Box<self>` before the snapshot. How to update your code: * Instead of `~EXPR`, you should write `box EXPR`. * Instead of `~TYPE`, you should write `Box<Type>`. * Instead of `~PATTERN`, you should write `box PATTERN`. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-1/+1
2014-04-30Add serialization support for StrBufHerman J. Radtke III-0/+12
- implement Encodable and Decodable for StrBuf - implement to_json for StrBuf
2014-04-19serialize: Remove errant println!'s from decodeRicho Healey-3/+0
2014-04-18Update the rest of the compiler with ~[T] changesAlex Crichton-5/+8
2014-03-27serialize: use ResultSean McArthur-223/+250
All of Decoder and Encoder's methods now return a Result. Encodable.encode() and Decodable.decode() return a Result as well. fixes #12292
2014-03-23auto merge of #13095 : alexcrichton/rust/serialize-tuple, r=huonwbors-140/+30
This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well as providing a generalized macro for generating these implementations from one invocation. Closes #13086
2014-03-23serialize: Read/emit tuples with {read,emit}_tupleAlex Crichton-140/+30
This commit moves from {read,emit}_seq for tuples to {read,emit}_tuple, as well as providing a generalized macro for generating these implementations from one invocation. Closes #13086
2014-03-22rustc: Remove all usage of manual deref()Alex Crichton-1/+1
Favor using '*' instead
2014-03-20Removing imports of std::vec_ng::VecAlex Crichton-1/+0
It's now in the prelude.
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-3/+3
Closes #12702
2014-03-13Remove Rc's borrow method to avoid conflicts with RefCell's borrow in ↵Eduard Burtescu-1/+1
Rc<RefCell<T>>.
2014-03-12serialize: make Paths serializableErick Tryzelaar-0/+27
2014-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-121/+0
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-0/+1
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-21libstd: Implement some convenience methods on vectorsPatrick Walton-0/+21
2014-02-05pull extra::{serialize, ebml} into a separate libserialize crateJeff Olson-0/+760
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library