Show / Hide Table of Contents

Struct Nibbles

Implements
IEquatable<Nibbles>
Inherited Members
Object.Equals(Object, Object)
System.Object.GetType()
Object.ReferenceEquals(Object, Object)
Namespace: Libplanet.Store.Trie
Assembly: Libplanet.Store.dll
Syntax
public readonly struct Nibbles : IEquatable<Nibbles>

Fields

| Improve this Doc View Source

Empty

Declaration
public static readonly Nibbles Empty
Field Value
Type Description
Nibbles

Properties

| Improve this Doc View Source

ByteArray

A list of langword_csharp_bytes representing raw nibbles where each nibble is assigned to a langword_csharp_byte.

Declaration
[Pure]
public readonly ImmutableArray<byte> ByteArray { get; }
Property Value
Type Description
System.Collections.Immutable.ImmutableArray<System.Byte>
| Improve this Doc View Source

Hex

The hex representation of the Nibbles. Unlike most other hex representations, returned langword_csharp_string is of the same length as ByteArray and can be of odd length.

Declaration
[Pure]
public readonly string Hex { get; }
Property Value
Type Description
String
| Improve this Doc View Source

Item[Int32]

Declaration
public readonly byte this[int index] { get; }
Parameters
Type Name Description
Int32 index
Property Value
Type Description
System.Byte
| Improve this Doc View Source

Length

Declaration
[Pure]
public readonly int Length { get; }
Property Value
Type Description
Int32

Methods

| Improve this Doc View Source

Add(Byte)

Declaration
public readonly Nibbles Add(byte b)
Parameters
Type Name Description
System.Byte b
Returns
Type Description
Nibbles
| Improve this Doc View Source

AddRange(in Nibbles)

Declaration
public readonly Nibbles AddRange(in Nibbles nibbles)
Parameters
Type Name Description
Nibbles nibbles
Returns
Type Description
Nibbles
| Improve this Doc View Source

AddRange(in ImmutableArray<Byte>)

Declaration
public readonly Nibbles AddRange(in ImmutableArray<byte> nibbles)
Parameters
Type Name Description
System.Collections.Immutable.ImmutableArray<System.Byte> nibbles
Returns
Type Description
Nibbles
| Improve this Doc View Source

Equals(Nibbles)

Declaration
public readonly bool Equals(Nibbles other)
Parameters
Type Name Description
Nibbles other
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Equals(Object)

Declaration
public override readonly bool Equals(object obj)
Parameters
Type Name Description
Object obj
Returns
Type Description
System.Boolean
Overrides
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

FromHex(String)

Declaration
public static Nibbles FromHex(string hex)
Parameters
Type Name Description
String hex
Returns
Type Description
Nibbles
| Improve this Doc View Source

FromKeyBytes(in KeyBytes)

Declaration
public static Nibbles FromKeyBytes(in KeyBytes keyBytes)
Parameters
Type Name Description
KeyBytes keyBytes
Returns
Type Description
Nibbles
| Improve this Doc View Source

GetHashCode()

Declaration
public override readonly int GetHashCode()
Returns
Type Description
Int32
Overrides
ValueType.GetHashCode()
| Improve this Doc View Source

Skip(Int32)

Declaration
public readonly Nibbles Skip(int count)
Parameters
Type Name Description
Int32 count
Returns
Type Description
Nibbles
| Improve this Doc View Source

Take(Int32)

Declaration
public readonly Nibbles Take(int count)
Parameters
Type Name Description
Int32 count
Returns
Type Description
Nibbles
| Improve this Doc View Source

ToKeyBytes()

Gets a KeyBytes representing compressed nibbles where each pair of nibbles is compacted into a langword_csharp_byte.

Declaration
[Pure]
public readonly KeyBytes ToKeyBytes()
Returns
Type Description
KeyBytes

A KeyBytes representing compacted nibbles.

Exceptions
Type Condition
InvalidOperationException

Thrown when Length is odd.

| Improve this Doc View Source

ToString()

Declaration
public override readonly string ToString()
Returns
Type Description
String
Overrides
System.ValueType.ToString()

Implements

System.IEquatable<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium