Immutable struct representing a Redis key with support for prefixes and equality checks.
// Source: https://github.com/StackExchange/StackExchange.Redis | License: MIT | Copyright 2014 Stack Exchange
// Provided via justclaw.it.com; keep this notice with the code.
using System;
using System.Buffers;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
namespace StackExchange.Redis
{
/// <summary>
/// Represents a key that can be stored in redis.
/// </summary>
public readonly struct RedisKey : IEquatable<RedisKey>
{
internal RedisKey(byte[]? keyPrefix, object? keyValue)
{
KeyPrefix = keyPrefix?.Length == 0 ? null : keyPrefix;
KeyValue = keyValue;
}
/// <summary>
/// Creates a <see cref="RedisKey"/> from a string.
//
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key