#[repr(u8)]pub enum IndexEncoding {
Unknown = 0,
Integer = 1,
FixedString = 2,
LengthPrefixed = 3,
Implied = 4,
IpAddress = 5,
}Expand description
How an INDEX component maps to instance-identifier sub-identifiers (RFC 2578, Section 7.7).
When a table row is identified by its index values, those values are
encoded as OID sub-identifiers appended to the column OID. The
encoding strategy depends on the index object’s BaseType and
constraints:
- Integer types use a single sub-identifier containing the value.
- Fixed-length strings (with a single-value SIZE constraint like
SIZE (6)) use one sub-identifier per octet, with no length prefix. - Variable-length strings are length-prefixed: one sub-identifier for the length, followed by one per octet.
- The
IMPLIEDkeyword omits the length prefix, but can only be used on the last index component since there is no way to tell where it ends otherwise.
This encoding matters when constructing or parsing instance OIDs programmatically (e.g. building an SNMP GET request for a specific table row).
Variants§
Unknown = 0
Encoding not yet determined.
Integer = 1
Single sub-identifier for integer-valued indexes.
FixedString = 2
Fixed number of sub-identifiers (SIZE-constrained OCTET STRING). No length prefix; the number of sub-identifiers equals the fixed SIZE.
LengthPrefixed = 3
Length prefix followed by that many sub-identifiers. Used for variable-length OCTET STRING and OBJECT IDENTIFIER indexes.
Implied = 4
No length prefix; the index value extends to the end of the OID.
Only valid for the last index component (uses the IMPLIED keyword).
IpAddress = 5
Four sub-identifiers encoding an IPv4 address (one per octet).
Trait Implementations§
Source§impl Clone for IndexEncoding
impl Clone for IndexEncoding
Source§fn clone(&self) -> IndexEncoding
fn clone(&self) -> IndexEncoding
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IndexEncoding
impl Debug for IndexEncoding
Source§impl Default for IndexEncoding
impl Default for IndexEncoding
Source§fn default() -> IndexEncoding
fn default() -> IndexEncoding
Source§impl Display for IndexEncoding
impl Display for IndexEncoding
Source§impl Hash for IndexEncoding
impl Hash for IndexEncoding
Source§impl PartialEq for IndexEncoding
impl PartialEq for IndexEncoding
impl Copy for IndexEncoding
impl Eq for IndexEncoding
impl StructuralPartialEq for IndexEncoding
Auto Trait Implementations§
impl Freeze for IndexEncoding
impl RefUnwindSafe for IndexEncoding
impl Send for IndexEncoding
impl Sync for IndexEncoding
impl Unpin for IndexEncoding
impl UnsafeUnpin for IndexEncoding
impl UnwindSafe for IndexEncoding
Blanket Implementations§
Source§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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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