Skip to content

Commit b30f00f

Browse files
committed
Add some more docs
1 parent 24ded33 commit b30f00f

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

libbitcoinkernel-sys/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ authors = ["TheCharlatan <[email protected]>"]
66
description = "Raw Rust bindings to libbitcoinkernel"
77
license = "MIT"
88
repository = "https://github.com/TheCharlatan/rust-bitcoinkernel"
9-
links = "libbitcoinkernel"
9+
links = "libbitcoinkernel.a"
1010
build = "build.rs"
1111

12-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
13-
1412
[dependencies]
1513
libc = "0.2"
1614

src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,28 +171,35 @@ impl From<ChainType> for kernel_ChainType {
171171
}
172172
}
173173

174+
/// The chain's tip was updated to the provided block hash.
174175
pub trait KNBlockTipFn: Fn(SynchronizationState, BlockHash) {}
175176
impl<F: Fn(SynchronizationState, BlockHash)> KNBlockTipFn for F {}
176177

178+
/// A new best block header was added.
177179
pub trait KNHeaderTipFn: Fn(SynchronizationState, i64, i64, bool) {}
178180
impl<F: Fn(SynchronizationState, i64, i64, bool)> KNHeaderTipFn for F {}
179181

182+
/// Reports on the current synchronization progress.
180183
pub trait KNProgressFn: Fn(String, i32, bool) {}
181184
impl<F: Fn(String, i32, bool)> KNProgressFn for F {}
182185

186+
/// A warning state issued by the kernel during validation.
183187
pub trait KNWarningSetFn: Fn(KernelWarning, String) {}
184188
impl<F: Fn(KernelWarning, String)> KNWarningSetFn for F {}
185189

190+
/// A previous condition leading to the issuance of a warning is no longer given.
186191
pub trait KNWarningUnsetFn: Fn(KernelWarning) {}
187192
impl<F: Fn(KernelWarning)> KNWarningUnsetFn for F {}
188193

194+
/// An error was encountered when flushing data to disk.
189195
pub trait KNFlushErrorFn: Fn(String) {}
190196
impl<F: Fn(String)> KNFlushErrorFn for F {}
191197

198+
/// An un-recoverable system error was encountered by the library.
192199
pub trait KNFatalErrorFn: Fn(String) {}
193200
impl<F: Fn(String)> KNFatalErrorFn for F {}
194201

195-
/// A callback holder struct for the notification interface call.
202+
/// A callback holder struct for the notification interface calls.
196203
pub struct KernelNotificationInterfaceCallbackHolder {
197204
pub kn_block_tip: Box<dyn KNBlockTipFn>,
198205
pub kn_header_tip: Box<dyn KNHeaderTipFn>,
@@ -499,6 +506,7 @@ impl From<kernel_BlockValidationResult> for BlockValidationResult {
499506
}
500507
}
501508

509+
/// Exposes the result after validating a block.
502510
pub trait VIBlockCheckedFn: Fn(ValidationMode, BlockValidationResult) {}
503511
impl<F: Fn(ValidationMode, BlockValidationResult)> VIBlockCheckedFn for F {}
504512

@@ -1154,6 +1162,7 @@ impl<'a> Drop for ChainstateManager<'a> {
11541162
}
11551163
}
11561164

1165+
/// A function for handling log messages produced by the kernel library.
11571166
pub trait Log {
11581167
fn log(&self, message: &str);
11591168
}

0 commit comments

Comments
 (0)