mirror of
https://github.com/arampoire/nut-rs.git
synced 2025-12-01 00:30:23 -05:00
Release 0.5.0
Rename to rups
This commit is contained in:
parent
539d11848e
commit
feef67255f
21 changed files with 51 additions and 47 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use anyhow::Context;
|
||||
|
||||
use nut_client::blocking::Connection;
|
||||
use nut_client::Config;
|
||||
use rups::blocking::Connection;
|
||||
use rups::Config;
|
||||
|
||||
/// Lists each UPS on the upsd server, one per line.
|
||||
pub fn list_devices(config: Config, with_description: bool) -> anyhow::Result<()> {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ fn main() -> anyhow::Result<()> {
|
|||
let ssl = insecure_ssl || args.is_present("ssl");
|
||||
|
||||
let host = server.try_into()?;
|
||||
let config = nut_client::ConfigBuilder::new()
|
||||
let config = rups::ConfigBuilder::new()
|
||||
.with_host(host)
|
||||
.with_debug(debug)
|
||||
.with_ssl(ssl)
|
||||
|
|
|
|||
|
|
@ -64,10 +64,10 @@ impl<'a> TryFrom<&'a str> for UpsdName<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a> TryInto<nut_client::Host> for UpsdName<'a> {
|
||||
impl<'a> TryInto<rups::Host> for UpsdName<'a> {
|
||||
type Error = anyhow::Error;
|
||||
|
||||
fn try_into(self) -> anyhow::Result<nut_client::Host> {
|
||||
fn try_into(self) -> anyhow::Result<rups::Host> {
|
||||
(self.hostname.to_owned(), self.port)
|
||||
.try_into()
|
||||
.with_context(|| "Invalid hostname/port")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue