pub struct ChainJob { /* private fields */ }Expand description
A job that tries to update the State’s internal CheckPoint to the latest tip.
The job can be completed with try_finish() given that we have all the blocks required to
complete the job. Otherwise, blocks can be introduced to the job with process_blocks().
Implementations§
Source§impl ChainJob
impl ChainJob
Sourcepub fn new(
queuer: ReqQueuer<'_>,
local_tip: &CheckPoint,
header: Header,
height: u32,
) -> Option<Self>
pub fn new( queuer: ReqQueuer<'_>, local_tip: &CheckPoint, header: Header, height: u32, ) -> Option<Self>
Construct ChainJob.
Returns None if no job is required. I.e. local_tip is already at height and header.
pub fn process_blocks( self, headers: impl IntoIterator<Item = (u32, BlockHash)>, ) -> Self
pub fn try_finish(self, local_tip: &mut CheckPoint) -> Result<CheckPoint, Self>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChainJob
impl RefUnwindSafe for ChainJob
impl Send for ChainJob
impl Sync for ChainJob
impl Unpin for ChainJob
impl UnsafeUnpin for ChainJob
impl UnwindSafe for ChainJob
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