[][src]Struct snmp_mp::ObjectIdent

pub struct ObjectIdent(_);

Represents an object identifier.

For SNMP the expectation is that there are at most 128 sub-identifiers in a value, and each sub-identifier has a maximum value of 4_294_967_295. These limits are not enforced by ObjectIdent.

Examples

use snmp_mp::ObjectIdent;

let sys_descr_oid = [1, 3, 6, 1, 2, 1, 1, 1];
let sys_descr = ObjectIdent::from_slice(&sys_descr_oid);
assert_eq!(sys_descr.components(), &sys_descr_oid);

Implementations

impl ObjectIdent[src]

pub fn new(components: Vec<u64>) -> Self[src]

Constructs a new ObjectIdent from a Vec<u64>.

Examples

let sys_descr_oid = vec![1, 3, 6, 1, 2, 1, 1, 1];
let sys_descr = ObjectIdent::new(sys_descr_oid.clone());
assert_eq!(sys_descr.components(), &sys_descr_oid[..]);

pub fn from_slice(components: &[u64]) -> Self[src]

Constructs a new ObjectIdent from a slice.

Examples

let sys_descr_oid = [1, 3, 6, 1, 2, 1, 1, 1];
let sys_descr = ObjectIdent::from_slice(&sys_descr_oid);
assert_eq!(sys_descr.components(), &sys_descr_oid);

pub fn components(&self) -> &[u64][src]

Returns the components of this ObjectIdent.

Examples

let sys_descr_oid = [1, 3, 6, 1, 2, 1, 1, 1];
let sys_descr = ObjectIdent::from_slice(&sys_descr_oid);
assert_eq!(sys_descr.components(), &sys_descr_oid);

Trait Implementations

impl Clone for ObjectIdent[src]

impl Debug for ObjectIdent[src]

impl Display for ObjectIdent[src]

impl Eq for ObjectIdent[src]

impl From<Vec<u64>> for ObjectIdent[src]

impl FromStr for ObjectIdent[src]

type Err = ParseOidError

The associated error which can be returned from parsing.

impl Hash for ObjectIdent[src]

impl Ord for ObjectIdent[src]

impl PartialEq<ObjectIdent> for ObjectIdent[src]

impl PartialOrd<ObjectIdent> for ObjectIdent[src]

impl StructuralEq for ObjectIdent[src]

impl StructuralPartialEq for ObjectIdent[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.