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 kn_callbacks(
self,
kn_callbacks: Box<KernelNotificationInterfaceCallbacks>,
) -> ContextBuilder
pub fn kn_callbacks( self, kn_callbacks: Box<KernelNotificationInterfaceCallbacks>, ) -> ContextBuilder
Sets the notifications callbacks to the passed in holder struct
Sourcepub fn chain_type(self, chain_type: ChainType) -> ContextBuilder
pub fn chain_type(self, chain_type: ChainType) -> ContextBuilder
Sets the chain type
Sourcepub fn validation_interface(
self,
vi_callbacks: Box<ValidationInterfaceCallbacks>,
) -> ContextBuilder
pub fn validation_interface( self, vi_callbacks: Box<ValidationInterfaceCallbacks>, ) -> ContextBuilder
Sets the validation interface callbacks
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