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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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