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\nid and mod number of shards. This is added to capture the old `account_id_to_shard_id` algorithm,\nto keep backward compatibility for some existing tests.\n`parent_shards` for `ShardLayoutV1` is always `None`, meaning it can only be the first shard layout\na 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: u64
Map accounts evenly across all shards
version: u32
Version 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§fn clone_from(&mut self, source: &Self)
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<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<&ShardLayoutV0> for ShardLayoutV0
impl From<&ShardLayoutV0> for ShardLayoutV0
Source§fn from(value: &ShardLayoutV0) -> Self
fn from(value: &ShardLayoutV0) -> 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.
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