pub struct ShardLayoutV0 {
pub num_shards: u64,
pub version: u32,
}Expand description
A shard layout that maps accounts evenly across all shards – by calculate the hash of account
id and mod number of shards. This is added to capture the old account_id_to_shard_id algorithm,
to keep backward compatibility for some existing tests.
parent_shards for ShardLayoutV1 is always None, meaning it can only be the first shard layout
a chain uses.
JSON schema
{
"description": "A shard layout that maps accounts evenly across all shards -- by calculate the hash of account\n id and mod number of shards. This is added to capture the old `account_id_to_shard_id` algorithm,\n to keep backward compatibility for some existing tests.\n `parent_shards` for `ShardLayoutV1` is always `None`, meaning it can only be the first shard layout\n a chain uses.",
"type": "object",
"required": [
"num_shards",
"version"
],
"properties": {
"num_shards": {
"description": "Map accounts evenly across all shards",
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"version": {
"description": "Version of the shard layout, this is useful for uniquely identify the shard layout",
"type": "integer",
"format": "uint32",
"minimum": 0.0
}
}
}Fields§
§num_shards: u64Map accounts evenly across all shards
version: u32Version of the shard layout, this is useful for uniquely identify the shard layout
Trait Implementations§
Source§impl Clone for ShardLayoutV0
impl Clone for ShardLayoutV0
Source§fn clone(&self) -> ShardLayoutV0
fn clone(&self) -> ShardLayoutV0
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 ShardLayoutV0
impl Debug for ShardLayoutV0
Source§impl<'de> Deserialize<'de> for ShardLayoutV0
impl<'de> Deserialize<'de> for ShardLayoutV0
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ShardLayoutV0, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ShardLayoutV0, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&ShardLayoutV0> for ShardLayoutV0
impl From<&ShardLayoutV0> for ShardLayoutV0
Source§fn from(value: &ShardLayoutV0) -> ShardLayoutV0
fn from(value: &ShardLayoutV0) -> ShardLayoutV0
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 Serialize for ShardLayoutV0
impl Serialize for ShardLayoutV0
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 ShardLayoutV0
impl RefUnwindSafe for ShardLayoutV0
impl Send for ShardLayoutV0
impl Sync for ShardLayoutV0
impl Unpin for ShardLayoutV0
impl UnwindSafe for ShardLayoutV0
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