use bytes::Bytes;
use std::sync::{Arc, Mutex};
use crate::commands::executable::Executable;
use crate::commands::CommandParser;
use crate::frame::Frame;
use crate::store::Store;
use crate::Error;
#[derive(Debug, PartialEq)]
pub struct Select {
pub index: Bytes,
}
impl Executable for Select {
fn exec(self, _store: Arc<Mutex<Store>>) -> Result<Frame, Error> {
Ok(Frame::Simple("OK".to_string()))
}
}
impl TryFrom<&mut CommandParser> for Select {
type Error = Error;
fn try_from(parser: &mut CommandParser) -> Result<Self, Self::Error> {
let index = parser.next_bytes()?;
Ok(Self { index })
}
}