pub struct SuperSegment {
pub header: SuperSegmentHeader,
pub segment_roots: Arc<[ShardSegmentRootWithPosition]>,
}Expand description
Super segment
Fields§
§header: SuperSegmentHeaderSuper segment root
segment_roots: Arc<[ShardSegmentRootWithPosition]>Segment roots that are included in the super segment
Implementations§
Source§impl SuperSegment
impl SuperSegment
Sourcepub fn new(
previous_header: &SuperSegmentHeader,
target_beacon_chain_block_number: BlockNumber,
segment_roots: StdArc<[ShardSegmentRootWithPosition]>,
) -> Option<Self>
pub fn new( previous_header: &SuperSegmentHeader, target_beacon_chain_block_number: BlockNumber, segment_roots: StdArc<[ShardSegmentRootWithPosition]>, ) -> Option<Self>
Create a new instance and derive super segment root.
Returns None if the list of segment roots is empty or there are too many of them.
Sourcepub fn proof_for_segment(&self, segment_position: u32) -> Option<SegmentProof>
pub fn proof_for_segment(&self, segment_position: u32) -> Option<SegmentProof>
Produce a proof for a segment in the super segment at a given position
Trait Implementations§
Source§impl Clone for SuperSegment
impl Clone for SuperSegment
Source§fn clone(&self) -> SuperSegment
fn clone(&self) -> SuperSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SuperSegment
impl Debug for SuperSegment
Source§impl<'de> Deserialize<'de> for SuperSegment
impl<'de> Deserialize<'de> for SuperSegment
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SuperSegment
impl RefUnwindSafe for SuperSegment
impl Send for SuperSegment
impl Sync for SuperSegment
impl Unpin for SuperSegment
impl UnsafeUnpin for SuperSegment
impl UnwindSafe for SuperSegment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more