@@ -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.
174175pub trait KNBlockTipFn : Fn ( SynchronizationState , BlockHash ) { }
175176impl < F : Fn ( SynchronizationState , BlockHash ) > KNBlockTipFn for F { }
176177
178+ /// A new best block header was added.
177179pub trait KNHeaderTipFn : Fn ( SynchronizationState , i64 , i64 , bool ) { }
178180impl < F : Fn ( SynchronizationState , i64 , i64 , bool ) > KNHeaderTipFn for F { }
179181
182+ /// Reports on the current synchronization progress.
180183pub trait KNProgressFn : Fn ( String , i32 , bool ) { }
181184impl < F : Fn ( String , i32 , bool ) > KNProgressFn for F { }
182185
186+ /// A warning state issued by the kernel during validation.
183187pub trait KNWarningSetFn : Fn ( KernelWarning , String ) { }
184188impl < F : Fn ( KernelWarning , String ) > KNWarningSetFn for F { }
185189
190+ /// A previous condition leading to the issuance of a warning is no longer given.
186191pub trait KNWarningUnsetFn : Fn ( KernelWarning ) { }
187192impl < F : Fn ( KernelWarning ) > KNWarningUnsetFn for F { }
188193
194+ /// An error was encountered when flushing data to disk.
189195pub trait KNFlushErrorFn : Fn ( String ) { }
190196impl < F : Fn ( String ) > KNFlushErrorFn for F { }
191197
198+ /// An un-recoverable system error was encountered by the library.
192199pub trait KNFatalErrorFn : Fn ( String ) { }
193200impl < 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 .
196203pub 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.
502510pub trait VIBlockCheckedFn : Fn ( ValidationMode , BlockValidationResult ) { }
503511impl < 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.
11571166pub trait Log {
11581167 fn log ( & self , message : & str ) ;
11591168}
0 commit comments