#[non_exhaustive]pub enum ErrorStatus {
Show 20 variants
NoError,
TooBig,
NoSuchName,
BadValue,
ReadOnly,
GenErr,
NoAccess,
WrongType,
WrongLength,
WrongEncoding,
WrongValue,
NoCreation,
InconsistentValue,
ResourceUnavailable,
CommitFailed,
UndoFailed,
AuthorizationError,
NotWritable,
InconsistentName,
Unknown(i32),
}Expand description
SNMP protocol error status codes (RFC 3416).
These codes are returned by SNMP agents to indicate the result of an operation.
The error status is included in the Error::Snmp variant along with an error
index indicating which varbind caused the error.
§Error Categories
§SNMPv1 Errors (0-5)
NoError- Operation succeededTooBig- Response too large for transportNoSuchName- OID not found (v1 only; v2c+ uses exceptions)BadValue- Invalid value in SETReadOnly- Attempted write to read-only objectGenErr- Unspecified error
§SNMPv2c/v3 Errors (6-18)
These provide more specific error information for SET operations:
NoAccess- Object not accessible (access control)WrongType- Value has wrong ASN.1 typeWrongLength- Value has wrong lengthWrongValue- Value out of range or invalidNotWritable- Object does not support SETAuthorizationError- Access denied by VACM
§Example
use async_snmp::ErrorStatus;
let status = ErrorStatus::from_i32(2);
assert_eq!(status, ErrorStatus::NoSuchName);
assert_eq!(status.as_i32(), 2);
println!("Error: {}", status); // prints "noSuchName"Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoError
Operation completed successfully (status = 0).
TooBig
Response message would be too large for transport (status = 1).
NoSuchName
Requested OID not found (status = 2). SNMPv1 only; v2c+ uses exception values.
BadValue
Invalid value provided in SET request (status = 3).
ReadOnly
Attempted to SET a read-only object (status = 4).
GenErr
Unspecified error occurred (status = 5).
NoAccess
Object exists but access is denied (status = 6).
WrongType
SET value has wrong ASN.1 type (status = 7).
WrongLength
SET value has incorrect length (status = 8).
WrongEncoding
SET value uses wrong encoding (status = 9).
WrongValue
SET value is out of range or otherwise invalid (status = 10).
NoCreation
Object does not support row creation (status = 11).
InconsistentValue
Value is inconsistent with other managed objects (status = 12).
Resource required for SET is unavailable (status = 13).
CommitFailed
SET commit phase failed (status = 14).
UndoFailed
SET undo phase failed (status = 15).
AuthorizationError
Access denied by VACM (status = 16).
NotWritable
Object does not support modification (status = 17).
InconsistentName
Named object cannot be created (status = 18).
Unknown(i32)
Unknown or future error status code.
Implementations§
Trait Implementations§
Source§impl Clone for ErrorStatus
impl Clone for ErrorStatus
Source§fn clone(&self) -> ErrorStatus
fn clone(&self) -> ErrorStatus
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more