Enum kvs::DBCommands
source · [−]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
Set up value by key into KVS
Get
Fields
key: String
Get value by key
Rm
Fields
key: String
Removes value by key
Implementations
sourceimpl DBCommands
impl DBCommands
sourcepub fn invoke_cmd<S: KvsEngine>(&self, store: &mut S) -> ServerResponse
pub fn invoke_cmd<S: KvsEngine>(&self, store: &mut S) -> ServerResponse
Invoke command on KvsEngine and return ServerResponse
sourcepub fn to_packet(self) -> Result<Vec<u8>>
pub fn to_packet(self) -> Result<Vec<u8>>
Pack DBCommands to bytes follow the protocol (consuming self) with HEAD and CRC-ARC hashsum
sourcepub fn from_stream(stream: &mut TcpStream) -> Result<Self>
pub fn from_stream(stream: &mut TcpStream) -> Result<Self>
Unpack DBCommands from incomming stream by protocol Check HEAD and CRC-ARC of packet
Trait Implementations
sourceimpl Debug for DBCommands
impl Debug for DBCommands
sourceimpl<'de> Deserialize<'de> for DBCommands
impl<'de> Deserialize<'de> for DBCommands
sourcefn 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
sourceimpl FromArgMatches for DBCommands
impl FromArgMatches for DBCommands
sourcefn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Instantiate Self
from [ArgMatches
], parsing the arguments as needed. Read more
sourcefn update_from_arg_matches<'b>(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches<'b>(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
Assign values from ArgMatches
to self
.
sourceimpl Serialize for DBCommands
impl Serialize for DBCommands
sourceimpl Subcommand for DBCommands
impl Subcommand for DBCommands
sourcefn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands<'b>(__clap_app: Command<'b>) -> Command<'b>
Append to [Command
] so it can instantiate Self
. Read more
sourcefn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
fn augment_subcommands_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>
Append to [Command
] so it can update self
. Read more
sourcefn has_subcommand(__clap_name: &str) -> bool
fn has_subcommand(__clap_name: &str) -> bool
Test whether Self
can parse a specific subcommand
Auto Trait Implementations
impl RefUnwindSafe for DBCommands
impl Send for DBCommands
impl Sync for DBCommands
impl Unpin for DBCommands
impl UnwindSafe for DBCommands
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more