pub struct TrapV1Notification { /* private fields */ }Expand description
A validated outbound SNMPv1 Trap PDU.
Implementations§
Source§impl TrapV1Notification
impl TrapV1Notification
Sourcepub fn new(
enterprise: Oid,
agent_addr: [u8; 4],
generic_trap: GenericTrap,
specific_trap: i32,
time_stamp: u32,
varbinds: Vec<VarBind>,
) -> Result<Self>
pub fn new( enterprise: Oid, agent_addr: [u8; 4], generic_trap: GenericTrap, specific_trap: i32, time_stamp: u32, varbinds: Vec<VarBind>, ) -> Result<Self>
Construct a validated outbound SNMPv1 Trap PDU.
§Errors
Unknown generic-trap values, receive-only values, values unavailable in
SNMPv1, and invalid OIDs are rejected. specific_trap is encoded as the
full protocol Integer32 field without imposing semantic constraints
that receivers such as net-snmp do not enforce.
Sourcepub fn try_from_raw(pdu: TrapV1Pdu) -> Result<Self>
pub fn try_from_raw(pdu: TrapV1Pdu) -> Result<Self>
Validate a decoded/raw SNMPv1 trap for outbound use.
Sourcepub fn enterprise(&self) -> &Oid
pub fn enterprise(&self) -> &Oid
Return the enterprise OID.
Sourcepub const fn agent_addr(&self) -> [u8; 4]
pub const fn agent_addr(&self) -> [u8; 4]
Return the originating agent IPv4 address.
Sourcepub const fn generic_trap(&self) -> GenericTrap
pub const fn generic_trap(&self) -> GenericTrap
Return the generic trap classification.
Sourcepub const fn specific_trap(&self) -> i32
pub const fn specific_trap(&self) -> i32
Return the specific trap Integer32 value.
Sourcepub const fn time_stamp(&self) -> u32
pub const fn time_stamp(&self) -> u32
Return the timestamp in hundredths of a second.
Trait Implementations§
Source§impl Clone for TrapV1Notification
impl Clone for TrapV1Notification
Source§fn clone(&self) -> TrapV1Notification
fn clone(&self) -> TrapV1Notification
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TrapV1Notification
impl Debug for TrapV1Notification
impl Eq for TrapV1Notification
Source§impl From<TrapV1Notification> for TrapV1Pdu
impl From<TrapV1Notification> for TrapV1Pdu
Source§fn from(value: TrapV1Notification) -> Self
fn from(value: TrapV1Notification) -> Self
Converts to this type from the input type.
Source§impl PartialEq for TrapV1Notification
impl PartialEq for TrapV1Notification
impl StructuralPartialEq for TrapV1Notification
Auto Trait Implementations§
impl Freeze for TrapV1Notification
impl RefUnwindSafe for TrapV1Notification
impl Send for TrapV1Notification
impl Sync for TrapV1Notification
impl Unpin for TrapV1Notification
impl UnsafeUnpin for TrapV1Notification
impl UnwindSafe for TrapV1Notification
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
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
Compare self to
key and return true if they are equal.