Enum LengthOp
#[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§
§impl LengthOp
impl LengthOp
pub 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.
pub fn from_str_name(value: &str) -> Option<LengthOp>
pub fn from_str_name(value: &str) -> Option<LengthOp>
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<LengthOp, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<LengthOp, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Ord for LengthOp
impl Ord for LengthOp
§impl PartialOrd for LengthOp
impl PartialOrd for LengthOp
§impl Serialize for LengthOp
impl Serialize for LengthOp
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
§impl TryFrom<i32> for LengthOp
impl TryFrom<i32> for LengthOp
§type Error = UnknownEnumValue
type Error = UnknownEnumValue
impl Copy for LengthOp
impl Eq for LengthOp
impl StructuralPartialEq for LengthOp
Auto Trait Implementations§
impl Freeze for LengthOp
impl RefUnwindSafe for LengthOp
impl Send for LengthOp
impl Sync for LengthOp
impl Unpin for LengthOp
impl UnwindSafe for LengthOp
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered
].