mirror of
https://github.com/aramperes/nut-rs.git
synced 2025-09-09 13:38:30 -04:00
parent
77d3020df5
commit
c56be76906
3 changed files with 21 additions and 0 deletions
|
@ -15,6 +15,8 @@ pub enum Command<'a> {
|
|||
StartTLS,
|
||||
/// Queries the network version.
|
||||
NetworkVersion,
|
||||
/// Queries the server version
|
||||
Version,
|
||||
}
|
||||
|
||||
impl<'a> Command<'a> {
|
||||
|
@ -27,6 +29,7 @@ impl<'a> Command<'a> {
|
|||
Self::List(_) => "LIST",
|
||||
Self::StartTLS => "STARTTLS",
|
||||
Self::NetworkVersion => "NETVER",
|
||||
Self::Version => "VER",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,6 +483,14 @@ implement_simple_commands! {
|
|||
{ |row: String| Ok(row) },
|
||||
)
|
||||
}
|
||||
|
||||
/// Queries the server NUT version.
|
||||
pub fn get_server_version() -> String {
|
||||
(
|
||||
{ Command::Version },
|
||||
{ |row: String| Ok(row) },
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
implement_action_commands! {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue