pub struct SerializableRocksStateMachine {
pub last_applied_log: Option<LogId<RocksNodeId>>,
pub last_membership: StoredMembership<RocksNodeId, BasicNode>,
pub data: BTreeMap<String, String>,
}
Expand description
Here defines a state machine of the raft, this state represents a copy of the data
between each node. Note that we are using serde
to serialize the data
, which has
a implementation to be serialized. Note that for this test we set both the key and
value as String, but you could set any type of value that has the serialization impl.
Fields§
§last_applied_log: Option<LogId<RocksNodeId>>
§last_membership: StoredMembership<RocksNodeId, BasicNode>
§data: BTreeMap<String, String>
Application data.
Trait Implementations§
source§impl Clone for SerializableRocksStateMachine
impl Clone for SerializableRocksStateMachine
source§fn clone(&self) -> SerializableRocksStateMachine
fn clone(&self) -> SerializableRocksStateMachine
Returns a copy 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 Default for SerializableRocksStateMachine
impl Default for SerializableRocksStateMachine
source§fn default() -> SerializableRocksStateMachine
fn default() -> SerializableRocksStateMachine
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for SerializableRocksStateMachine
impl<'de> Deserialize<'de> for SerializableRocksStateMachine
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<&RocksStateMachine> for SerializableRocksStateMachine
impl From<&RocksStateMachine> for SerializableRocksStateMachine
source§fn from(state: &RocksStateMachine) -> Self
fn from(state: &RocksStateMachine) -> Self
Converts to this type from the input type.