Changeset View
Changeset View
Standalone View
Standalone View
chronik/chronik-bridge/src/ffi.rs
Show First 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | unsafe extern "C++" { | ||||
/// when an unrecoverable error occured. | /// when an unrecoverable error occured. | ||||
fn abort_node(msg: &str, user_msg: &str); | fn abort_node(msg: &str, user_msg: &str); | ||||
/// Returns true if a shutdown is requested, false otherwise. | /// Returns true if a shutdown is requested, false otherwise. | ||||
/// See `ShutdownRequested` in `shutdown.h`. | /// See `ShutdownRequested` in `shutdown.h`. | ||||
fn shutdown_requested() -> bool; | fn shutdown_requested() -> bool; | ||||
} | } | ||||
} | } | ||||
/// SAFETY: All fields of ChronikBridge (const Consensus::Params &, const | |||||
/// node::NodeContext &) can be moved betweed threads safely. | |||||
#[allow(unsafe_code)] | |||||
unsafe impl Send for ChronikBridge {} | |||||
/// SAFETY: All fields of ChronikBridge (const Consensus::Params &, const | |||||
/// node::NodeContext &) can be accessed from different threads safely. | |||||
#[allow(unsafe_code)] | |||||
unsafe impl Sync for ChronikBridge {} | |||||
impl std::fmt::Debug for ChronikBridge { | |||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | |||||
f.debug_struct("ChronikBridge").finish_non_exhaustive() | |||||
} | |||||
} |