pub enum DBCommands {
    Set {
        key: String,
        value: String,
    },
    Get {
        key: String,
    },
    Rm {
        key: String,
    },
}
Expand description

Enumeration to define a commands to KVS engine

Variants

Set

Fields

key: String
value: String

Set up value by key into KVS

Get

Fields

key: String

Get value by key

Rm

Fields

key: String

Removes value by key

Implementations

Invoke command on KvsEngine and return ServerResponse

Pack DBCommands to bytes follow the protocol (consuming self) with HEAD and CRC-ARC hashsum

Unpack DBCommands from incomming stream by protocol Check HEAD and CRC-ARC of packet

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more

Assign values from ArgMatches to self.

Serialize this value into the given Serde serializer. Read more

Append to [Command] so it can instantiate Self. Read more

Append to [Command] so it can update self. Read more

Test whether Self can parse a specific subcommand

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.