#[repr(i32)]pub enum LengthOp {
NoPrefix = 0,
VarProto = 1,
VarRlp = 2,
Fixed32Big = 3,
Fixed32Little = 4,
Fixed64Big = 5,
Fixed64Little = 6,
Require32Bytes = 7,
Require64Bytes = 8,
}
Expand description
LengthOp defines how to process the key and value of the LeafOp to include length information. After encoding the length with the given algorithm, the length will be prepended to the key and value bytes. (Each one with it’s own encoded length)
Variants§
NoPrefix = 0
NO_PREFIX don’t include any length info
VarProto = 1
VAR_PROTO uses protobuf (and go-amino) varint encoding of the length
VarRlp = 2
VAR_RLP uses rlp int encoding of the length
Fixed32Big = 3
FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer
Fixed32Little = 4
FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer
Fixed64Big = 5
FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer
Fixed64Little = 6
FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer
Require32Bytes = 7
REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)
Require64Bytes = 8
REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)
Implementations§
source§impl LengthOp
impl LengthOp
sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
§impl<'de> Deserialize<'de> for LengthOp
impl<'de> Deserialize<'de> for LengthOp
§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Ord for LengthOp
impl Ord for LengthOp
source§impl PartialEq for LengthOp
impl PartialEq for LengthOp
source§impl PartialOrd for LengthOp
impl PartialOrd for LengthOp
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more