Enum near_primitives::sharding::EncodedShardChunk

source ·
pub enum EncodedShardChunk {
    V1(EncodedShardChunkV1),
    V2(EncodedShardChunkV2),
}

Variants§

Implementations§

source§

impl EncodedShardChunk

source

pub fn cloned_header(&self) -> ShardChunkHeader

source

pub fn content(&self) -> &EncodedShardChunkBody

source

pub fn content_mut(&mut self) -> &mut EncodedShardChunkBody

source

pub fn shard_id(&self) -> ShardId

source

pub fn encoded_merkle_root(&self) -> CryptoHash

source

pub fn encoded_length(&self) -> u64

source

pub fn from_header( header: ShardChunkHeader, total_parts: usize, protocol_version: ProtocolVersion ) -> Self

source

pub fn encode_transaction_receipts( rs: &ReedSolomonWrapper, transactions: Vec<SignedTransaction>, outgoing_receipts: &[Receipt] ) -> Result<(Vec<Option<Box<[u8]>>>, u64), Error>

source

pub fn new( prev_block_hash: CryptoHash, prev_state_root: StateRoot, prev_outcome_root: CryptoHash, height: BlockHeight, shard_id: ShardId, rs: &mut ReedSolomonWrapper, prev_gas_used: Gas, gas_limit: Gas, prev_balance_burnt: Balance, tx_root: CryptoHash, prev_validator_proposals: Vec<ValidatorStake>, transactions: Vec<SignedTransaction>, prev_outgoing_receipts: &[Receipt], prev_outgoing_receipts_root: CryptoHash, signer: &dyn ValidatorSigner, protocol_version: ProtocolVersion ) -> Result<(Self, Vec<MerklePath>), Error>

source

pub fn chunk_hash(&self) -> ChunkHash

source

pub fn create_partial_encoded_chunk( &self, part_ords: Vec<u64>, receipts: Vec<ReceiptProof>, merkle_paths: &[MerklePath] ) -> PartialEncodedChunk

source

pub fn create_partial_encoded_chunk_with_arc_receipts( &self, part_ords: Vec<u64>, receipts: Vec<Arc<ReceiptProof>>, merkle_paths: &[MerklePath] ) -> PartialEncodedChunkWithArcReceipts

source

pub fn decode_chunk(&self, data_parts: usize) -> Result<ShardChunk, Error>

Trait Implementations§

source§

impl BorshDeserialize for EncodedShardChunk

source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

source§

fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.
source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

source§

impl BorshSerialize for EncodedShardChunk

source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

source§

impl Clone for EncodedShardChunk

source§

fn clone(&self) -> EncodedShardChunk

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EncodedShardChunk

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl EnumExt for EncodedShardChunk

source§

fn deserialize_variant<__R: Read>( reader: &mut __R, variant_tag: u8 ) -> Result<Self, Error>

Deserialises given variant of an enum from the reader. Read more
source§

impl PartialEq for EncodedShardChunk

source§

fn eq(&self, other: &EncodedShardChunk) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for EncodedShardChunk

source§

impl StructuralPartialEq for EncodedShardChunk

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more