pub struct ContextBuilder { /* private fields */ }
Expand description
Builder struct for the kernel Context
.
The builder by default configures for mainnet and swallows any kernel notifications.
Implementations§
Source§impl ContextBuilder
impl ContextBuilder
pub fn new() -> ContextBuilder
Sourcepub fn build(self) -> Result<Context, KernelError>
pub fn build(self) -> Result<Context, KernelError>
Consumes the builder and creates a Context
.
§Errors
Returns KernelError::Internal
if Context
creation fails.
Sourcepub fn chain_type(self, chain_type: ChainType) -> ContextBuilder
pub fn chain_type(self, chain_type: ChainType) -> ContextBuilder
Sets the chain type
pub fn with_block_tip_notification<T>(self, handler: T) -> Selfwhere
T: BlockTipCallback + 'static,
pub fn with_progress_notification<T>(self, handler: T) -> Selfwhere
T: ProgressCallback + 'static,
pub fn with_header_tip_notification<T>(self, handler: T) -> Selfwhere
T: HeaderTipCallback + 'static,
pub fn with_warning_set_notification<T>(self, handler: T) -> Selfwhere
T: WarningSetCallback + 'static,
pub fn with_warning_unset_notification<T>(self, handler: T) -> Selfwhere
T: WarningUnsetCallback + 'static,
pub fn with_flush_error_notification<T>(self, handler: T) -> Selfwhere
T: FlushErrorCallback + 'static,
pub fn with_fatal_error_notification<T>(self, handler: T) -> Selfwhere
T: FatalErrorCallback + 'static,
pub fn notifications<F>(self, configure: F) -> Selfwhere
F: FnOnce(&mut NotificationCallbackRegistry),
pub fn with_block_checked_validation<T>(self, handler: T) -> Selfwhere
T: BlockCheckedCallback + 'static,
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ContextBuilder
impl !RefUnwindSafe for ContextBuilder
impl !Send for ContextBuilder
impl !Sync for ContextBuilder
impl Unpin for ContextBuilder
impl !UnwindSafe for ContextBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more