susy_codec/
lib.rs

1// Copyright 2017, 2018 Susy 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 = "susy-codec-derive")]
27#[allow(unused_imports)]
28#[macro_use]
29extern crate susy_codec_derive;
30
31#[cfg(all(feature = "std", test))]
32#[macro_use]
33extern crate serde_derive;
34
35#[cfg(feature = "susy-codec-derive")]
36#[doc(hidden)]
37pub use susy_codec_derive::*;
38
39#[cfg(feature = "std")]
40pub mod alloc {
41	pub use std::boxed;
42	pub use std::vec;
43	pub use std::string;
44	pub use std::borrow;
45	pub use std::collections;
46
47	#[cfg(feature = "full")]
48	mod full {
49		pub use std::borrow;
50	}
51	#[cfg(feature = "full")]
52	pub use self::full::*;
53}
54
55mod codec;
56mod joiner;
57mod keyedvec;
58
59pub use self::codec::{
60	Input, Output, Encode, Decode, Codec, Compact, HasCompact, EncodeAsRef,
61	CompactAs, EncodeAppend
62};
63pub use self::joiner::Joiner;
64pub use self::keyedvec::KeyedVec;