tetsy_codec/
lib.rs

1// Copyright 2017, 2018 Parity Technologies
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// tag::description[]
16//! Implements a serialization and deserialization codec for simple marshalling.
17// end::description[]
18
19#![cfg_attr(not(feature = "std"), no_std)]
20#![cfg_attr(not(feature = "std"), feature(alloc))]
21
22#[cfg(not(feature = "std"))]
23#[macro_use]
24extern crate alloc;
25
26#[cfg(feature = "std")]
27extern crate core;
28
29#[cfg(feature = "std")]
30extern crate serde;
31
32extern crate arrayvec;
33
34#[cfg(feature = "tetsy-codec-derive")]
35#[allow(unused_imports)]
36#[macro_use]
37extern crate tetsy_codec_derive;
38
39#[cfg(all(feature = "std", test))]
40#[macro_use]
41extern crate serde_derive;
42
43#[cfg(feature = "tetsy-codec-derive")]
44#[doc(hidden)]
45pub use tetsy_codec_derive::*;
46
47#[cfg(feature = "std")]
48pub mod alloc {
49	pub use ::std::boxed;
50	pub use ::std::vec;
51	pub use ::std::string;
52	pub use ::std::borrow;
53
54	#[cfg(feature = "full")]
55	mod full {
56		pub use ::std::borrow;
57	}
58	#[cfg(feature = "full")]
59	pub use self::full::*;
60}
61
62mod codec;
63mod joiner;
64mod keyedvec;
65
66pub use self::codec::{Input, Output, Encode, Decode, Codec, Compact, HasCompact, EncodeAsRef, CompactAs};
67pub use self::joiner::Joiner;
68pub use self::keyedvec::KeyedVec;