1 // This file is Copyright its original authors, visible in version control
2 // history and in the source files from which this was generated.
4 // This file is licensed under the license available in the LICENSE or LICENSE.md
5 // file in the root of this repository or, if no such file exists, the same
6 // license as that which applies to the original source files from which this
7 // source was automatically generated.
10 //! Rust-Lightning, not Rusty's Lightning!
12 //! A full-featured but also flexible lightning implementation, in library form. This allows the
13 //! user (you) to decide how they wish to use it instead of being a fully self-contained daemon.
14 //! This means there is no built-in threading/execution environment and it's up to the user to
15 //! figure out how best to make networking happen/timers fire/things get written to disk/keys get
16 //! generated/etc. This makes it a good candidate for tight integration into an existing wallet
17 //! instead of having a rather-separate lightning appendage to a wallet.
19 //! `default` features are:
21 //! * `std` - enables functionalities which require `std`, including `std::io` trait implementations and things which utilize time
22 //! * `grind_signatures` - enables generation of [low-r bitcoin signatures](https://bitcoin.stackexchange.com/questions/111660/what-is-signature-grinding),
23 //! which saves 1 byte per signature in 50% of the cases (see [bitcoin PR #13666](https://github.com/bitcoin/bitcoin/pull/13666))
25 //! Available features are:
28 //! * `grind_signatures`
29 //! * `no-std ` - exposes write trait implementations from the `core2` crate (at least one of `no-std` or `std` are required)
30 //! * Skip logging of messages at levels below the given log level:
32 //! * `max_level_error`
33 //! * `max_level_warn`
34 //! * `max_level_info`
35 //! * `max_level_debug`
36 //! * `max_level_trace`
38 use alloc::str::FromStr;
39 use alloc::string::String;
40 use core::ffi::c_void;
41 use core::convert::Infallible;
42 use bitcoin::hashes::Hash;
43 use crate::c_types::*;
44 #[cfg(feature="no-std")]
45 use alloc::{vec::Vec, boxed::Box};
53 pub mod onion_message;
58 use alloc::str::FromStr;
59 use alloc::string::String;
60 use core::ffi::c_void;
61 use core::convert::Infallible;
62 use bitcoin::hashes::Hash;
63 use crate::c_types::*;
64 #[cfg(feature="no-std")]
65 use alloc::{vec::Vec, boxed::Box};
69 use alloc::str::FromStr;
70 use alloc::string::String;
71 use core::ffi::c_void;
72 use core::convert::Infallible;
73 use bitcoin::hashes::Hash;
74 use crate::c_types::*;
75 #[cfg(feature="no-std")]
76 use alloc::{vec::Vec, boxed::Box};
80 use alloc::str::FromStr;
81 use alloc::string::String;
82 use core::ffi::c_void;
83 use core::convert::Infallible;
84 use bitcoin::hashes::Hash;
85 use crate::c_types::*;
86 #[cfg(feature="no-std")]
87 use alloc::{vec::Vec, boxed::Box};
93 use alloc::str::FromStr;
94 use alloc::string::String;
95 use core::ffi::c_void;
96 use core::convert::Infallible;
97 use bitcoin::hashes::Hash;
98 use crate::c_types::*;
99 #[cfg(feature="no-std")]
100 use alloc::{vec::Vec, boxed::Box};
103 mod chacha20poly1305rfc {
105 use alloc::str::FromStr;
106 use alloc::string::String;
107 use core::ffi::c_void;
108 use core::convert::Infallible;
109 use bitcoin::hashes::Hash;
110 use crate::c_types::*;
111 #[cfg(feature="no-std")]
112 use alloc::{vec::Vec, boxed::Box};
114 mod real_chachapoly {
116 use alloc::str::FromStr;
117 use alloc::string::String;
118 use core::ffi::c_void;
119 use core::convert::Infallible;
120 use bitcoin::hashes::Hash;
121 use crate::c_types::*;
122 #[cfg(feature="no-std")]
123 use alloc::{vec::Vec, boxed::Box};
129 use alloc::str::FromStr;
130 use alloc::string::String;
131 use core::ffi::c_void;
132 use core::convert::Infallible;
133 use bitcoin::hashes::Hash;
134 use crate::c_types::*;
135 #[cfg(feature="no-std")]
136 use alloc::{vec::Vec, boxed::Box};
141 use alloc::str::FromStr;
142 use alloc::string::String;
143 use core::ffi::c_void;
144 use core::convert::Infallible;
145 use bitcoin::hashes::Hash;
146 use crate::c_types::*;
147 #[cfg(feature="no-std")]
148 use alloc::{vec::Vec, boxed::Box};
154 use alloc::str::FromStr;
155 use alloc::string::String;
156 use core::ffi::c_void;
157 use core::convert::Infallible;
158 use bitcoin::hashes::Hash;
159 use crate::c_types::*;
160 #[cfg(feature="no-std")]
161 use alloc::{vec::Vec, boxed::Box};
166 use alloc::str::FromStr;
167 use alloc::string::String;
168 use core::ffi::c_void;
169 use core::convert::Infallible;
170 use bitcoin::hashes::Hash;
171 use crate::c_types::*;
172 #[cfg(feature="no-std")]
173 use alloc::{vec::Vec, boxed::Box};
177 use alloc::str::FromStr;
178 use alloc::string::String;
179 use core::ffi::c_void;
180 use core::convert::Infallible;
181 use bitcoin::hashes::Hash;
182 use crate::c_types::*;
183 #[cfg(feature="no-std")]
184 use alloc::{vec::Vec, boxed::Box};
189 use alloc::str::FromStr;
190 use alloc::string::String;
191 use core::ffi::c_void;
192 use core::convert::Infallible;
193 use bitcoin::hashes::Hash;
194 use crate::c_types::*;
195 #[cfg(feature="no-std")]
196 use alloc::{vec::Vec, boxed::Box};