Struct reth_static_file_types::SegmentHeader
source · pub struct SegmentHeader { /* private fields */ }
Expand description
A segment header that contains information common to all segments. Used for storage.
Implementations§
source§impl SegmentHeader
impl SegmentHeader
sourcepub const fn new(
expected_block_range: SegmentRangeInclusive,
block_range: Option<SegmentRangeInclusive>,
tx_range: Option<SegmentRangeInclusive>,
segment: StaticFileSegment,
) -> Self
pub const fn new( expected_block_range: SegmentRangeInclusive, block_range: Option<SegmentRangeInclusive>, tx_range: Option<SegmentRangeInclusive>, segment: StaticFileSegment, ) -> Self
Returns SegmentHeader
.
sourcepub const fn segment(&self) -> StaticFileSegment
pub const fn segment(&self) -> StaticFileSegment
Returns the static file segment kind.
sourcepub const fn block_range(&self) -> Option<&SegmentRangeInclusive>
pub const fn block_range(&self) -> Option<&SegmentRangeInclusive>
Returns the block range.
sourcepub const fn tx_range(&self) -> Option<&SegmentRangeInclusive>
pub const fn tx_range(&self) -> Option<&SegmentRangeInclusive>
Returns the transaction range.
sourcepub const fn expected_block_start(&self) -> BlockNumber
pub const fn expected_block_start(&self) -> BlockNumber
The expected block start of the segment.
sourcepub const fn expected_block_end(&self) -> BlockNumber
pub const fn expected_block_end(&self) -> BlockNumber
The expected block end of the segment.
sourcepub fn block_start(&self) -> Option<BlockNumber>
pub fn block_start(&self) -> Option<BlockNumber>
Returns the first block number of the segment.
sourcepub fn tx_start(&self) -> Option<TxNumber>
pub fn tx_start(&self) -> Option<TxNumber>
Returns the first transaction number of the segment.
sourcepub fn increment_block(&mut self) -> BlockNumber
pub fn increment_block(&mut self) -> BlockNumber
Increments block end range depending on segment
sourcepub fn increment_tx(&mut self)
pub fn increment_tx(&mut self)
Increments tx end range depending on segment
sourcepub fn set_block_range(
&mut self,
block_start: BlockNumber,
block_end: BlockNumber,
)
pub fn set_block_range( &mut self, block_start: BlockNumber, block_end: BlockNumber, )
Sets a new block_range
.
sourcepub fn set_tx_range(&mut self, tx_start: TxNumber, tx_end: TxNumber)
pub fn set_tx_range(&mut self, tx_start: TxNumber, tx_end: TxNumber)
Sets a new tx_range
.
Trait Implementations§
source§impl Clone for SegmentHeader
impl Clone for SegmentHeader
source§fn clone(&self) -> SegmentHeader
fn clone(&self) -> SegmentHeader
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SegmentHeader
impl Debug for SegmentHeader
source§impl<'de> Deserialize<'de> for SegmentHeader
impl<'de> Deserialize<'de> for SegmentHeader
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for SegmentHeader
impl Hash for SegmentHeader
source§impl PartialEq for SegmentHeader
impl PartialEq for SegmentHeader
source§impl Serialize for SegmentHeader
impl Serialize for SegmentHeader
impl Eq for SegmentHeader
impl StructuralPartialEq for SegmentHeader
Auto Trait Implementations§
impl Freeze for SegmentHeader
impl RefUnwindSafe for SegmentHeader
impl Send for SegmentHeader
impl Sync for SegmentHeader
impl Unpin for SegmentHeader
impl UnwindSafe for SegmentHeader
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes