sval_buffer/
lib.rs

1/*!
2Buffering support for `sval`.
3
4This crate provides the [`ValueBuf`] type, which can buffer a flat
5stream of data into a tree of borrowed values.
6
7Some functionality requires the `alloc` Cargo feature to be enabled.
8Rather than conditionally compile these methods, this library stubs
9out functionality when an allocator isn't available.
10*/
11
12#![no_std]
13#![deny(missing_docs)]
14
15mod error;
16
17#[cfg(feature = "std")]
18#[macro_use]
19#[allow(unused_imports)]
20extern crate std as libstd;
21
22#[cfg(not(feature = "alloc"))]
23extern crate core as std;
24
25#[cfg(any(test, feature = "alloc"))]
26#[macro_use]
27#[allow(unused_imports)]
28extern crate alloc;
29#[cfg(feature = "alloc")]
30extern crate core;
31
32#[cfg(feature = "alloc")]
33mod std {
34    #[allow(unused_imports)]
35    pub use crate::{
36        alloc::{borrow, boxed, collections, string, vec},
37        core::{convert, fmt, hash, marker, mem, ops, result, str},
38    };
39
40    #[cfg(feature = "std")]
41    pub use libstd::error;
42}
43
44mod fragments;
45mod value;
46
47#[cfg(feature = "alloc")]
48fn assert_static<T: 'static>(_: &mut T) {}
49
50pub use self::{error::*, fragments::*, value::*};