pub struct StateEntry {
pub timestamp: u64,
pub name: OpenVpnState,
pub description: String,
pub local_ip: String,
pub remote_ip: String,
pub remote_port: Option<u16>,
pub local_addr: String,
pub local_port: Option<u16>,
pub local_ipv6: String,
}Expand description
A single state history entry from the state command’s multi-line response.
Wire format: timestamp,state_name,description,local_ip,remote_ip,remote_port,local_addr,local_port,local_ipv6
Fields mirror Notification::State exactly.
use openvpn_mgmt_codec::parsed_response::parse_state_entry;
let entry = parse_state_entry("1711234567,CONNECTED,SUCCESS,10.8.0.6,198.51.100.1,1194,,").unwrap();
assert_eq!(entry.timestamp, 1711234567);
assert_eq!(entry.name.to_string(), "CONNECTED");
assert_eq!(entry.remote_ip, "198.51.100.1");
assert_eq!(entry.remote_port, Some(1194));Fields§
§timestamp: u64Unix timestamp of the state change.
name: OpenVpnStateState name (e.g. Connected, Reconnecting).
description: StringVerbose description (mostly for RECONNECTING/EXITING).
local_ip: StringTUN/TAP local IPv4 address (may be empty).
remote_ip: StringRemote server address (may be empty).
remote_port: Option<u16>Remote server port (empty in many states).
local_addr: StringLocal address (may be empty).
local_port: Option<u16>Local port (empty in many states).
local_ipv6: StringTUN/TAP local IPv6 address (may be empty).
Trait Implementations§
Source§impl Clone for StateEntry
impl Clone for StateEntry
Source§fn clone(&self) -> StateEntry
fn clone(&self) -> StateEntry
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 StateEntry
impl Debug for StateEntry
impl Eq for StateEntry
Source§impl PartialEq for StateEntry
impl PartialEq for StateEntry
impl StructuralPartialEq for StateEntry
Auto Trait Implementations§
impl Freeze for StateEntry
impl RefUnwindSafe for StateEntry
impl Send for StateEntry
impl Sync for StateEntry
impl Unpin for StateEntry
impl UnsafeUnpin for StateEntry
impl UnwindSafe for StateEntry
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