pub struct ResponsePdu { /* private fields */ }Expand description
A validated outbound Response or SNMPv3 Report PDU.
Implementations§
Source§impl ResponsePdu
impl ResponsePdu
Sourcepub fn new(
version: Version,
request_id: i32,
status: OutboundErrorStatus,
error_index: Option<ErrorIndex>,
varbinds: Vec<VarBind>,
) -> Result<Self>
pub fn new( version: Version, request_id: i32, status: OutboundErrorStatus, error_index: Option<ErrorIndex>, varbinds: Vec<VarBind>, ) -> Result<Self>
Construct a validated Response PDU.
error_index must be None for noError, tooBig, undoFailed, and
authorizationError. All other errors require a checked one-based index.
Sourcepub fn success(
version: Version,
request_id: i32,
varbinds: Vec<VarBind>,
) -> Result<Self>
pub fn success( version: Version, request_id: i32, varbinds: Vec<VarBind>, ) -> Result<Self>
Construct a successful Response PDU.
Sourcepub fn too_big(
version: Version,
request_id: i32,
varbinds: Vec<VarBind>,
) -> Result<Self>
pub fn too_big( version: Version, request_id: i32, varbinds: Vec<VarBind>, ) -> Result<Self>
Construct a version-correct tooBig Response PDU.
Sourcepub fn report(request_id: i32, varbinds: Vec<VarBind>) -> Result<Self>
pub fn report(request_id: i32, varbinds: Vec<VarBind>) -> Result<Self>
Construct an SNMPv3 Report PDU with zero error fields.
Sourcepub fn try_from_raw(version: Version, pdu: Pdu) -> Result<Self>
pub fn try_from_raw(version: Version, pdu: Pdu) -> Result<Self>
Validate a decoded/raw PDU as an outbound response-class PDU.
Sourcepub const fn version(&self) -> Version
pub const fn version(&self) -> Version
Return the SNMP version against which this response was validated.
Sourcepub const fn request_id(&self) -> i32
pub const fn request_id(&self) -> i32
Return the request identifier being answered.
Sourcepub fn status(&self) -> OutboundErrorStatus
pub fn status(&self) -> OutboundErrorStatus
Return the validated error status.
Sourcepub fn error_index(&self) -> Option<ErrorIndex>
pub fn error_index(&self) -> Option<ErrorIndex>
Return the checked one-based error index, if the status uses one.
Sourcepub fn set_request_id(&mut self, request_id: i32)
pub fn set_request_id(&mut self, request_id: i32)
Change the request identifier without affecting any other invariant.
Trait Implementations§
Source§impl Clone for ResponsePdu
impl Clone for ResponsePdu
Source§fn clone(&self) -> ResponsePdu
fn clone(&self) -> ResponsePdu
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 ResponsePdu
impl Debug for ResponsePdu
impl Eq for ResponsePdu
Source§impl From<ResponsePdu> for Pdu
impl From<ResponsePdu> for Pdu
Source§fn from(value: ResponsePdu) -> Self
fn from(value: ResponsePdu) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ResponsePdu
impl PartialEq for ResponsePdu
impl StructuralPartialEq for ResponsePdu
Auto Trait Implementations§
impl Freeze for ResponsePdu
impl RefUnwindSafe for ResponsePdu
impl Send for ResponsePdu
impl Sync for ResponsePdu
impl Unpin for ResponsePdu
impl UnsafeUnpin for ResponsePdu
impl UnwindSafe for ResponsePdu
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.