[−][src]Module iredismodule::rtype
Redis data type supports
Examples
pub struct MyType { pub data: i64, } #[rtypedef("mytype123", 0)] impl TypeMethod for MyType { fn rdb_load(io: &mut IO, encver: u32) -> Option<Box<Self>> { if encver != 0 { return None; } let data = io.load_signed(); Some(Box::new(MyType { data })) } fn rdb_save(&self, io: &mut IO) { io.save_signed(self.data); } fn free(_: Box<Self>) {} fn aof_rewrite<T: AsRef<str>>(&self, io: &mut IO, key: T) { io.emit_aof( "HELLOTYPE.INSERT", &[key, self.data.to_string().as_str() ], ) } } define_module! { ... data_types: [ MYTYPE, ], ... }
Structs
RType | A redis data type |
Enums
AuxSaveTriggerFlag | Biflags for |
Traits
TypeMethod | A help trait for registing new data type |