use alloc::{vec::Vec, boxed::Box};
/// An enum representing the available verbosity levels of the logger.
-#[must_use]
#[derive(Clone)]
+#[must_use]
#[repr(C)]
pub enum Level {
/// Designates extremely verbose information, including gossip-induced messages
/// Designates very serious errors
Error,
}
-use lightning::util::logger::Level as nativeLevel;
+use lightning::util::logger::Level as LevelImport;
+pub(crate) type nativeLevel = LevelImport;
+
impl Level {
#[allow(unused)]
pub(crate) fn to_native(&self) -> nativeLevel {
pub extern "C" fn Level_eq(a: &Level, b: &Level) -> bool {
if &a.to_native() == &b.to_native() { true } else { false }
}
-/// Checks if two Levels contain equal inner contents.
+/// Generates a non-cryptographic 64-bit hash of the Level.
#[no_mangle]
pub extern "C" fn Level_hash(o: &Level) -> u64 {
// Note that we'd love to use alloc::collections::hash_map::DefaultHasher but it's not in core
#[allow(unused)]
/// Used only if an object of this type is returned as a trait impl by a method
pub(crate) extern "C" fn Record_free_void(this_ptr: *mut c_void) {
- unsafe { let _ = Box::from_raw(this_ptr as *mut nativeRecord); }
+ let _ = unsafe { Box::from_raw(this_ptr as *mut nativeRecord) };
}
#[allow(unused)]
impl Record {