Struct csnmp::client::Snmp2cClient

source ·
pub struct Snmp2cClient { /* private fields */ }
Expand description

A SNMP2c client.

Implementations§

Creates a new SNMP2c client.

Returns the socket address of the target SNMP agent.

Changes the socket address of the target SNMP agent.

Panics if the current target address has a different address family (e.g. due to a differing IP version) than the new target address.

Returns a reference to the community string used to authenticate the communication.

Changes the community string used to authenticate the communication.

Returns the binding address used to create this SNMP client.

Returns the duration that this SNMP client waits for a message to be sent or received before it gives up.

Changes the duration that this SNMP client waits for a message to be sent or received before it gives up.

Obtains the value for a single SNMP object.

Obtains the value for the next object in the tree relative to the given OID. This is a low-level operation, used as a building block for [walk].

Obtains the values for the next objects in the tree relative to the given OID. This is a low-level operation, used as a building block for [walk_bulk].

Sends a trap message, informing a management station about one or more events.

Sends an Inform message, informing a management station about one or more events. In contrast to a trap message, Inform messages incur a response.

Walks an OID tree from the given OID, collecting and returning the results.

This is a high-level operation using [get] and [get_next] under the hood.

Unless the agent you are querying has issues with the Get-Bulk operation, using [walk_bulk] is far more efficient.

Walks an OID tree from the given OID, collecting and returning the results.

This is a high-level operation using [get] and [get_bulk] under the hood.

You can generally set non_repeaters to 0. Tune max_repetitions to your liking; 10 is a good starting value.

Since [get_bulk] is functionally equivalent to [get_next] but fetches multiple values at once, [walk_bulk] is more efficient than [walk]. However, some SNMP agents may be buggy and provide different results to a [get_bulk] operation than to an equivalent sequence of [get_next] operations. Therefore, [walk] is still provided.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.