pub enum ShardLayout {
V0(ShardLayoutV0),
V1(ShardLayoutV1),
V2(ShardLayoutV2),
}
Expand description
A versioned struct that contains all information needed to assign accounts to shards.
Because of re-sharding, the chain may use different shard layout to split shards at different
times. Currently, ShardLayout
is stored as part of EpochConfig
, which is generated each
epoch given the epoch protocol version. In mainnet/testnet, we use two shard layouts since
re-sharding has only happened once. It is stored as part of genesis config, see
default_simple_nightshade_shard_layout() Below is an overview for some important
functionalities of ShardLayout interface.
JSON schema
{
"description": "A versioned struct that contains all information needed to assign accounts to shards.\n\nBecause of re-sharding, the chain may use different shard layout to split shards at different\ntimes. Currently, `ShardLayout` is stored as part of `EpochConfig`, which is generated each\nepoch given the epoch protocol version. In mainnet/testnet, we use two shard layouts since\nre-sharding has only happened once. It is stored as part of genesis config, see\ndefault_simple_nightshade_shard_layout() Below is an overview for some important\nfunctionalities of ShardLayout interface.",
"oneOf": [
{
"type": "object",
"required": [
"V0"
],
"properties": {
"V0": {
"$ref": "#/components/schemas/ShardLayoutV0"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"V1"
],
"properties": {
"V1": {
"$ref": "#/components/schemas/ShardLayoutV1"
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"V2"
],
"properties": {
"V2": {
"$ref": "#/components/schemas/ShardLayoutV2"
}
},
"additionalProperties": false
}
]
}
Variants§
Trait Implementations§
Source§impl Clone for ShardLayout
impl Clone for ShardLayout
Source§fn clone(&self) -> ShardLayout
fn clone(&self) -> ShardLayout
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 ShardLayout
impl Debug for ShardLayout
Source§impl<'de> Deserialize<'de> for ShardLayout
impl<'de> Deserialize<'de> for ShardLayout
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
Source§impl From<&ShardLayout> for ShardLayout
impl From<&ShardLayout> for ShardLayout
Source§fn from(value: &ShardLayout) -> Self
fn from(value: &ShardLayout) -> Self
Converts to this type from the input type.
Source§impl From<ShardLayoutV0> for ShardLayout
impl From<ShardLayoutV0> for ShardLayout
Source§fn from(value: ShardLayoutV0) -> Self
fn from(value: ShardLayoutV0) -> Self
Converts to this type from the input type.
Source§impl From<ShardLayoutV1> for ShardLayout
impl From<ShardLayoutV1> for ShardLayout
Source§fn from(value: ShardLayoutV1) -> Self
fn from(value: ShardLayoutV1) -> Self
Converts to this type from the input type.
Source§impl From<ShardLayoutV2> for ShardLayout
impl From<ShardLayoutV2> for ShardLayout
Source§fn from(value: ShardLayoutV2) -> Self
fn from(value: ShardLayoutV2) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ShardLayout
impl RefUnwindSafe for ShardLayout
impl Send for ShardLayout
impl Sync for ShardLayout
impl Unpin for ShardLayout
impl UnwindSafe for ShardLayout
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