Enum csnmp::message::ObjectValue
source · pub enum ObjectValue {
Integer(i32),
String(Vec<u8>),
ObjectId(ObjectIdentifier),
IpAddress(Ipv4Addr),
Counter32(u32),
Unsigned32(u32),
TimeTicks(u32),
Opaque(Vec<u8>),
Counter64(u64),
}
Expand description
A single SNMP value.
This is a representation of ObjectSyntax
as defined in RFC2578.
Variants§
Integer(i32)
String(Vec<u8>)
ObjectId(ObjectIdentifier)
IpAddress(Ipv4Addr)
Counter32(u32)
Unsigned32(u32)
TimeTicks(u32)
Opaque(Vec<u8>)
Counter64(u64)
Implementations§
source§impl ObjectValue
impl ObjectValue
sourcepub fn as_u32(&self) -> Option<u32>
pub fn as_u32(&self) -> Option<u32>
Returns [Some(u32)
] if this ObjectValue
is a Counter32
,
Unsigned32
, or TimeTicks
;
otherwise, returns None
.
sourcepub fn as_u64(&self) -> Option<u64>
pub fn as_u64(&self) -> Option<u64>
Returns [Some(u64)
] if this ObjectValue
is a Counter32
,
Unsigned32
, TimeTicks
, or
Counter64
; otherwise, returns None
.
sourcepub fn as_oid(&self) -> Option<ObjectIdentifier>
pub fn as_oid(&self) -> Option<ObjectIdentifier>
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Returns whether this ObjectValue
is an Integer
.
sourcepub fn is_object_id(&self) -> bool
pub fn is_object_id(&self) -> bool
Returns whether this ObjectValue
is an ObjectId
.
sourcepub fn is_ip_address(&self) -> bool
pub fn is_ip_address(&self) -> bool
Returns whether this ObjectValue
is an IpAddress
.
sourcepub fn is_counter32(&self) -> bool
pub fn is_counter32(&self) -> bool
Returns whether this ObjectValue
is a Counter32
.
sourcepub fn is_unsigned32(&self) -> bool
pub fn is_unsigned32(&self) -> bool
Returns whether this ObjectValue
is an Unsigned32
.
sourcepub fn is_time_ticks(&self) -> bool
pub fn is_time_ticks(&self) -> bool
Returns whether this ObjectValue
is a TimeTicks
.
sourcepub fn is_counter64(&self) -> bool
pub fn is_counter64(&self) -> bool
Returns whether this ObjectValue
is a Counter64
.
sourcepub fn as_type_str(&self) -> &'static str
pub fn as_type_str(&self) -> &'static str
Returns the string representation of this ObjectValue
’s type.
Trait Implementations§
source§impl Clone for ObjectValue
impl Clone for ObjectValue
source§fn clone(&self) -> ObjectValue
fn clone(&self) -> ObjectValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ObjectValue
impl Debug for ObjectValue
source§impl FromASN1 for ObjectValue
impl FromASN1 for ObjectValue
source§impl Hash for ObjectValue
impl Hash for ObjectValue
source§impl PartialEq for ObjectValue
impl PartialEq for ObjectValue
source§fn eq(&self, other: &ObjectValue) -> bool
fn eq(&self, other: &ObjectValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToASN1 for ObjectValue
impl ToASN1 for ObjectValue
impl Eq for ObjectValue
impl StructuralEq for ObjectValue
impl StructuralPartialEq for ObjectValue
Auto Trait Implementations§
impl RefUnwindSafe for ObjectValue
impl Send for ObjectValue
impl Sync for ObjectValue
impl Unpin for ObjectValue
impl UnwindSafe for ObjectValue
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
Mutably borrows from an owned value. Read more