In the context of the rdb_save method of a module type, saves a * string into the RDB file taking as input a RedisModuleString. * * The string can be later loaded with RedisModule_LoadString() or * other Load family functions expecting a serialized string inside * the RDB file. */
| 4808 | * other Load family functions expecting a serialized string inside |
| 4809 | * the RDB file. */ |
| 4810 | void RM_SaveString(RedisModuleIO *io, RedisModuleString *s) { |
| 4811 | if (io->error) return; |
| 4812 | /* Save opcode. */ |
| 4813 | ssize_t retval = rdbSaveLen(io->prio, RDB_MODULE_OPCODE_STRING); |
| 4814 | if (retval == -1) goto saveerr; |
| 4815 | io->bytes += retval; |
| 4816 | /* Save value. */ |
| 4817 | retval = rdbSaveStringObject(io->prio, s); |
| 4818 | if (retval == -1) goto saveerr; |
| 4819 | io->bytes += retval; |
| 4820 | return; |
| 4821 | |
| 4822 | saveerr: |
| 4823 | io->error = 1; |
| 4824 | } |
| 4825 | |
| 4826 | /* Like RedisModule_SaveString() but takes a raw C pointer and length |
| 4827 | * as input. */ |
nothing calls this directly
no test coverage detected