docs.rs failed to build rong_redis-0.3.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
rong_redis
Async Redis client. Exposed as Rong.RedisClient.
JS APIs
Rong.RedisClient— Redis client classnew Rong.RedisClient(url)— create a client with an explicit Redis URLconnect()— explicitly connect (optional, commands auto-connect)close()— close the connectionconnected— whether a connection is currently held
- String operations
set(key, value)— set a keyget(key)— get a key (returnsnullif missing)del(key)— delete a keyexists(key)— check if a key existsexpire(key, seconds)— set TTLttl(key)— get remaining TTL
- Numeric operations
incr(key)/decr(key)— increment / decrement
- Hash operations
hset(key, field, value)/hget(key, field)— single fieldhmset(key, [field, value, ...])/hmget(key, [field, ...])— multiple fieldshincrby(key, field, n)/hincrbyfloat(key, field, n)— increment field
- Set operations
sadd(key, member)/srem(key, member)— add / removesismember(key, member)— check membershipsmembers(key)— get all memberssrandmember(key)/spop(key)— random member / pop
- List operations
lpush(key, value)/rpush(key, value)— pushlpop(key)/rpop(key)— poplrange(key, start, stop)— get rangellen(key)— get length
- Pub/Sub
publish(channel, message)— publish a messagesubscribe(channel, { signal? }?)— returns aRedisSubscriptionasync iteratorRedisSubscription.close()— explicitly close a subscriptionfor await...ofwithbreakcloses the underlying subscription via iteratorreturn()
- Raw commands
send(command, args)— execute any Redis command
Namespaced Injected Clients
When a RedisClient is created from Rust with a non-empty namespace_prefix, the
following JS API restriction applies:
send()is disabled — throwsTypeError. Raw commands could bypass the namespace prefix, breaking isolation. Use the typed methods (set,get,hset, etc.) instead, which automatically apply the prefix.
Rust API
RedisClient::new(url, namespace_prefix)— create a pre-configured client from Rust, useful for environments that inject instances via a platform namespace instead of exposing the JS constructor.