What
Initial implementation and type/signature proposal for cuprated as a library.
#516.
Where
binaries/cuprated could be a double binary/library.
Another option is binaries/cuprated could be turned into a thin shell around a new library that contains the core node functionality, perhaps this would be cleaner.
Library name/location: TODO.
How
Some changes/fixes are necessary as binaries/cuprated currently assumes it is a standalone binary e.g.:
- Many types/signatures are
pub
- Global
rayon, tokio, tracing usage; these will panic when initialized elsewhere
- CLI handling is intermixed with the config code, this must be separated
API (wip)
//! # `cuprated` library.
/// An active `cuprated` node.
///
/// `Drop` will end the node process.
pub struct Node {/* ... */}
pub struct NodeConfig {/* ... */}
pub struct NodeEventListener {/* ... */}
impl Node {
/// Launch a new `cuprated` process.
pub fn launch(conifg: NodeConfig) -> Result<Self, Error>;
/// `Stream` of events emitted by `cuprated`.
pub fn events(&self) -> NodeEventListener;
/// Current config in use.
pub fn config(&self) -> &NodeConfig;
}
pub mod statics {
/* `binaries/cuprated/src/statics.rs` could be moved here */
}
pub mod signals {
/* `binaries/cuprated/src/signals.rs` could be moved here */
}
What
Initial implementation and type/signature proposal for
cupratedas a library.#516.
Where
binaries/cupratedcould be a double binary/library.Another option is
binaries/cupratedcould be turned into a thin shell around a new library that contains the core node functionality, perhaps this would be cleaner.Library name/location: TODO.
How
Some changes/fixes are necessary as
binaries/cupratedcurrently assumes it is a standalone binary e.g.:pubrayon,tokio,tracingusage; these will panic when initialized elsewhereAPI (wip)