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. */
| 4702 | * other Load family functions expecting a serialized string inside |
| 4703 | * the RDB file. */ |
| 4704 | void RM_SaveString(RedisModuleIO *io, RedisModuleString *s) { |
| 4705 | if (io->error) return; |
| 4706 | /* Save opcode. */ |
| 4707 | ssize_t retval = rdbSaveLen(io->rio, RDB_MODULE_OPCODE_STRING); |
| 4708 | if (retval == -1) goto saveerr; |
| 4709 | io->bytes += retval; |
| 4710 | /* Save value. */ |
| 4711 | retval = rdbSaveStringObject(io->rio, s); |
| 4712 | if (retval == -1) goto saveerr; |
| 4713 | io->bytes += retval; |
| 4714 | return; |
| 4715 | |
| 4716 | saveerr: |
| 4717 | io->error = 1; |
| 4718 | } |
| 4719 | |
| 4720 | /* Like RedisModule_SaveString() but takes a raw C pointer and length |
| 4721 | * as input. */ |
nothing calls this directly
no test coverage detected