Skip to content

Commit

Permalink
v0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmocatta committed Oct 17, 2018
1 parent a542490 commit 913bb85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "serde_traitobject"
version = "0.1.1"
version = "0.1.2"
license = "Apache-2.0"
authors = ["Alec Mocatta <alec@mocatta.net>"]
categories = ["development-tools","encoding","rust-patterns","network-programming"]
Expand All @@ -12,7 +12,7 @@ This library enables the serialization of trait objects such that they can be se
"""
repository = "https://github.com/alecmocatta/serde_traitobject"
homepage = "https://github.com/alecmocatta/serde_traitobject"
documentation = "https://docs.rs/serde_traitobject/0.1.1"
documentation = "https://docs.rs/serde_traitobject/0.1.2"
readme = "README.md"

[badges]
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This library enables the serialization of trait objects such that they can be se

For example, if you have multiple forks of a process, or the same binary running on each of a cluster of machines, this library would help you to send trait objects between them.

The heart of this crate is the [Serialize](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Serialize.html) and [Deserialize](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Deserialize.html) traits. They are automatically implemented for all `T: serde::Serialize` and all `T: serde::de::DeserializeOwned` respectively.
The heart of this crate is the [Serialize](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Serialize.html) and [Deserialize](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Deserialize.html) traits. They are automatically implemented for all `T: serde::Serialize` and all `T: serde::de::DeserializeOwned` respectively.

Any trait can be made (de)serializable when made into a trait object by simply adding them as supertraits:

Expand All @@ -34,12 +34,12 @@ struct Message(#[serde(with = "serde_traitobject")] Box<dyn MyTrait>);
```

There are two ways to use serde_traitobject to handle the (de)serialization:
* `#[serde(with = "serde_traitobject")]` [field attribute](https://serde.rs/attributes.html) on a boxed trait object, which instructs serde to use the [serialize](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/fn.serialize.html) and [deserialize](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/fn.deserialize.html) functions;
* The [Box](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/struct.Box.html), [Rc](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/struct.Rc.html) and [Arc](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/struct.Arc.html) structs, which are simple wrappers around their stdlib counterparts that automatically handle (de)serialization without needing the above annotation;
* `#[serde(with = "serde_traitobject")]` [field attribute](https://serde.rs/attributes.html) on a boxed trait object, which instructs serde to use the [serialize](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/fn.serialize.html) and [deserialize](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/fn.deserialize.html) functions;
* The [Box](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/struct.Box.html), [Rc](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/struct.Rc.html) and [Arc](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/struct.Arc.html) structs, which are simple wrappers around their stdlib counterparts that automatically handle (de)serialization without needing the above annotation;

Additionally, there are several convenience traits implemented that extend their stdlib counterparts:

* [Any](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Any.html), [Debug](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Debug.html), [Display](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Display.html), [Error](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Error.html), [Fn](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.Fn.html), [FnBox](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.FnBox.html), [FnMut](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.FnMut.html), [FnOnce](https://docs.rs/serde_traitobject/0.1.1/serde_traitobject/trait.FnOnce.html)
* [Any](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Any.html), [Debug](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Debug.html), [Display](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Display.html), [Error](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Error.html), [Fn](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.Fn.html), [FnBox](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.FnBox.html), [FnMut](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.FnMut.html), [FnOnce](https://docs.rs/serde_traitobject/0.1.2/serde_traitobject/trait.FnOnce.html)

These are automatically implemented on all (de)serializable implementors of their stdlib counterparts:

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
//!
//! This currently requires Rust nightly.

#![doc(html_root_url = "https://docs.rs/serde_traitobject/0.1.1")]
#![doc(html_root_url = "https://docs.rs/serde_traitobject/0.1.2")]
#![feature(
unboxed_closures,
fn_traits,
Expand Down

0 comments on commit 913bb85

Please sign in to comment.