pub struct SystemVariables {
pub ordered_vars: Vec<(String, String)>,
pub vars: HashMap<String, String>,
pub associd: u16,
pub status: u16,
pub display_status: u16,
}Expand description
Typed system variables parsed from Mode 6 text response.
Fields§
§ordered_vars: Vec<(String, String)>§vars: HashMap<String, String>§associd: u16§status: u16§display_status: u16Status word used for the display description.
Real C ntpq issues a separate status-summary request (count=0)
whose response status word is used for the textual description
(leap/source/event), while the full READVAR response’s status
word is shown as status=XXXX. When these differ, this field
holds the separate status word for description; self.status
is always the READVAR header status.
Implementations§
Source§impl SystemVariables
impl SystemVariables
pub fn from_text(data: &str, associd: u16, status: u16) -> SystemVariables
Sourcepub fn with_display_status(self, display_status: u16) -> SystemVariables
pub fn with_display_status(self, display_status: u16) -> SystemVariables
Set a separate display status (from a status-summary request).
pub fn get(&self, key: &str) -> Option<&str>
pub fn stratum(&self) -> u8
pub fn leap_str(&self) -> &str
Sourcepub fn status_description(&self) -> String
pub fn status_description(&self) -> String
Status description matching real ntpq output format.
Uses display_status (which may come from a separate status-summary
request in the C ntpq) for the textual description, while self.status
is always the READVAR header value shown as status=XXXX.
Format matches real C ntpq: “leap_xxx, sync_xxx, N event, [flags,]”
Trait Implementations§
Source§impl Clone for SystemVariables
impl Clone for SystemVariables
Source§fn clone(&self) -> SystemVariables
fn clone(&self) -> SystemVariables
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more