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\n Because of re-sharding, the chain may use different shard layout to split shards at different\n times. Currently, `ShardLayout` is stored as part of `EpochConfig`, which is generated each\n epoch given the epoch protocol version. In mainnet/testnet, we use two shard layouts since\n re-sharding has only happened once. It is stored as part of genesis config, see\n default_simple_nightshade_shard_layout() Below is an overview for some important\n functionalities 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§const fn clone_from(&mut self, source: &Self)
const 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<ShardLayout, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ShardLayout, <__D as Deserializer<'de>>::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) -> ShardLayout
fn from(value: &ShardLayout) -> ShardLayout
Converts to this type from the input type.
Source§impl From<ShardLayoutV0> for ShardLayout
impl From<ShardLayoutV0> for ShardLayout
Source§fn from(value: ShardLayoutV0) -> ShardLayout
fn from(value: ShardLayoutV0) -> ShardLayout
Converts to this type from the input type.
Source§impl From<ShardLayoutV1> for ShardLayout
impl From<ShardLayoutV1> for ShardLayout
Source§fn from(value: ShardLayoutV1) -> ShardLayout
fn from(value: ShardLayoutV1) -> ShardLayout
Converts to this type from the input type.
Source§impl From<ShardLayoutV2> for ShardLayout
impl From<ShardLayoutV2> for ShardLayout
Source§fn from(value: ShardLayoutV2) -> ShardLayout
fn from(value: ShardLayoutV2) -> ShardLayout
Converts to this type from the input type.
Source§impl Serialize for ShardLayout
impl Serialize for ShardLayout
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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