MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_SaveString

Function RM_SaveString

app/redis-6.2.6/src/module.c:4704–4718  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

4702 * other Load family functions expecting a serialized string inside
4703 * the RDB file. */
4704void 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
4716saveerr:
4717 io->error = 1;
4718}
4719
4720/* Like RedisModule_SaveString() but takes a raw C pointer and length
4721 * as input. */

Callers

nothing calls this directly

Calls 2

rdbSaveLenFunction · 0.85
rdbSaveStringObjectFunction · 0.85

Tested by

no test coverage detected