pub enum RocksRequest {
    Set {
        key: String,
        value: String,
    },
}
Expand description

Here you will set the types of request that will interact with the raft nodes. For example the Set will be used to write data (key and value) to the raft database. The AddNode will append a new node to the current existing shared list of nodes. You will want to add any request that can write data in all nodes here.

Variants§

§

Set

Fields

§value: String

Trait Implementations§

source§

impl Clone for RocksRequest

source§

fn clone(&self) -> RocksRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RocksRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for RocksRequest

source§

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 RaftStorage<RocksRequest, RocksResponse> for Arc<RocksStore>

§

type SnapshotData = Cursor<Vec<u8, Global>>

The storage engine’s associated type used for exposing a snapshot for reading & writing. Read more
source§

fn save_hard_state<'life0, 'life1, 'async_trait>( &'life0 self, vote: &'life1 HardState ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn read_hard_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Option<HardState>, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

fn append_to_log<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, entries: &'life1 [&'life2 Entry<RocksRequest>] ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Append a payload of entries to the log. Read more
source§

fn delete_conflict_logs_since<'life0, 'async_trait>( &'life0 self, log_id: LogId ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Delete conflict log entries since log_id, inclusive.
source§

fn purge_logs_upto<'life0, 'async_trait>( &'life0 self, log_id: LogId ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Delete applied log entries upto log_id, inclusive.
source§

fn get_log_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<LogState, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the last deleted log id and the last log id. Read more
source§

fn try_get_log_entries<'life0, 'async_trait, RB>( &'life0 self, range: RB ) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<RocksRequest>>, StorageError>> + Send + 'async_trait>>where RB: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync, Self: 'async_trait, 'life0: 'async_trait,

Get a series of log entries from storage. Read more
source§

fn last_applied_state<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(Option<LogId>, Option<EffectiveMembership>), StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the last applied log id which is recorded in state machine, and the last applied membership log id and membership config.
source§

fn apply_to_state_machine<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, entries: &'life1 [&'life2 Entry<RocksRequest>] ) -> Pin<Box<dyn Future<Output = Result<Vec<RocksResponse>, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Apply the given payload of entries to the state machine. Read more
source§

fn build_snapshot<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Snapshot<Cursor<Vec<u8>>>, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Build snapshot Read more
source§

fn begin_receiving_snapshot<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Box<Self::SnapshotData>, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Create a new blank snapshot, returning a writable handle to the snapshot object. Read more
source§

fn install_snapshot<'life0, 'life1, 'async_trait>( &'life0 self, meta: &'life1 SnapshotMeta, snapshot: Box<Self::SnapshotData> ) -> Pin<Box<dyn Future<Output = Result<StateMachineChanges, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Install a snapshot which has finished streaming from the cluster leader. Read more
source§

fn get_current_snapshot<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Option<Snapshot<Self::SnapshotData>>, StorageError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Get a readable handle to the current snapshot, along with its metadata. Read more
source§

impl Serialize for RocksRequest

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> AppData for Twhere T: Clone + Send + Sync + Serialize + DeserializeOwned + 'static,

source§

impl<T> AppDataResponse for Twhere T: Clone + Send + Sync + Serialize + DeserializeOwned + 'static,

source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,