metadata switch
@@ -16,6 +16,7 @@ pub struct RedisCodec {
decode_as_response: bool,
batch_hint: usize,
current_frames: Vec<Frame>,
+ enable_metadata: bool,
}
fn get_keys(
@@ -134,6 +135,7 @@ impl RedisCodec {
decode_as_response,
batch_hint,
current_frames: vec![],
+ enable_metadata: false,
}
}
@@ -558,6 +560,13 @@ impl RedisCodec {
}
pub fn process_redis_frame(&self, frame: Frame) -> Result<Message> {
+ return if !self.enable_metadata {
+ Ok(Message {
+ details: MessageDetails::Unknown,
+ modified: false,
+ original: RawFrame::Redis(frame),
+ })
+ } else {
Ok(match frame.clone() {
Frame::SimpleString(s) => self.handle_redis_string(s, frame),
Frame::BulkString(bs) => self.handle_redis_bulkstring(bs, frame),
@@ -586,6 +595,7 @@ impl RedisCodec {
}
}
})
+ };
}
pub fn build_redis_response_frame(resp: QueryResponse) -> Frame {
