scale_info/
prelude.rs

1// Copyright 2019-2022 Parity Technologies (UK) Ltd.
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//! Exports from `std`, `core` and `alloc` crates.
16//!
17//! Guarantees a stable interface between `std` and `no_std` modes.
18
19#[cfg(not(feature = "std"))]
20extern crate alloc;
21
22use cfg_if::cfg_if;
23
24cfg_if! {
25    if #[cfg(feature = "std")] {
26        pub use std::{
27            any,
28            borrow,
29            boxed,
30            cmp,
31            collections,
32            fmt,
33            format,
34            hash,
35            marker,
36            mem,
37            num,
38            ops,
39            string,
40            sync,
41            time,
42            vec,
43            rc,
44            iter,
45        };
46    } else {
47        pub use alloc::{
48            borrow,
49            boxed,
50            collections,
51            format,
52            string,
53            sync,
54            vec,
55            rc
56        };
57
58        pub use core::{
59            any,
60            cmp,
61            fmt,
62            hash,
63            marker,
64            mem,
65            num,
66            ops,
67            time,
68            iter,
69        };
70    }
71}