Struct ConfigBuilder

Source
pub struct ConfigBuilder { /* private fields */ }
Expand description

A builder for Config.

Implementations§

Source§

impl ConfigBuilder

Source

pub fn new() -> Self

Initializes an empty builder for Config.

Examples found in repository?
examples/blocking.rs (line 19)
7fn main() -> nut_client::Result<()> {
8    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
9    let port = env::var("NUT_PORT")
10        .ok()
11        .map(|s| s.parse::<u16>().ok())
12        .flatten()
13        .unwrap_or(3493);
14
15    let username = env::var("NUT_USER").ok();
16    let password = env::var("NUT_PASSWORD").ok();
17    let auth = username.map(|username| Auth::new(username, password));
18
19    let config = ConfigBuilder::new()
20        .with_host((host, port).try_into().unwrap_or_default())
21        .with_auth(auth)
22        .with_debug(false) // Turn this on for debugging network chatter
23        .build();
24
25    let mut conn = Connection::new(&config)?;
26
27    // Get server information
28    println!("NUT server:");
29    println!("\tVersion: {}", conn.get_server_version()?);
30    println!("\tNetwork Version: {}", conn.get_network_version()?);
31
32    // Print a list of all UPS devices
33    println!("Connected UPS devices:");
34    for (name, description) in conn.list_ups()? {
35        println!("\t- Name: {}", name);
36        println!("\t  Description: {}", description);
37        println!("\t  Number of logins: {}", conn.get_num_logins(&name)?);
38
39        // Get list of mutable variables
40        let mutable_vars = conn.list_mutable_vars(&name)?;
41
42        // List UPS variables (key = val)
43        println!("\t  Mutable Variables:");
44        for var in mutable_vars.iter() {
45            println!("\t\t- {}", var);
46            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
47        }
48
49        // List UPS immutable properties (key = val)
50        println!("\t  Immutable Properties:");
51        for var in conn.list_vars(&name)? {
52            if mutable_vars.iter().any(|v| v.name() == var.name()) {
53                continue;
54            }
55            println!("\t\t- {}", var);
56            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
57        }
58
59        // List UPS commands
60        println!("\t  Commands:");
61        for cmd in conn.list_commands(&name)? {
62            let description = conn.get_command_description(&name, &cmd)?;
63            println!("\t\t- {} ({})", cmd, description);
64        }
65    }
66
67    // Gracefully shut down the connection using the `LOGOUT` command
68    conn.close()
69}
More examples
Hide additional examples
examples/async.rs (line 20)
8async fn main() -> nut_client::Result<()> {
9    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
10    let port = env::var("NUT_PORT")
11        .ok()
12        .map(|s| s.parse::<u16>().ok())
13        .flatten()
14        .unwrap_or(3493);
15
16    let username = env::var("NUT_USER").ok();
17    let password = env::var("NUT_PASSWORD").ok();
18    let auth = username.map(|username| Auth::new(username, password));
19
20    let config = ConfigBuilder::new()
21        .with_host((host, port).try_into().unwrap_or_default())
22        .with_auth(auth)
23        .with_debug(false) // Turn this on for debugging network chatter
24        .build();
25
26    let mut conn = Connection::new(&config).await?;
27
28    // Get server information
29    println!("NUT server:");
30    println!("\tVersion: {}", conn.get_server_version().await?);
31    println!("\tNetwork Version: {}", conn.get_network_version().await?);
32
33    // Print a list of all UPS devices
34    println!("Connected UPS devices:");
35    for (name, description) in conn.list_ups().await? {
36        println!("\t- Name: {}", name);
37        println!("\t  Description: {}", description);
38        println!(
39            "\t  Number of logins: {}",
40            conn.get_num_logins(&name).await?
41        );
42
43        // Get list of mutable variables
44        let mutable_vars = conn.list_mutable_vars(&name).await?;
45
46        // List UPS variables (key = val)
47        println!("\t  Mutable Variables:");
48        for var in mutable_vars.iter() {
49            println!("\t\t- {}", var);
50            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
51        }
52
53        // List UPS immutable properties (key = val)
54        println!("\t  Immutable Properties:");
55        for var in conn.list_vars(&name).await? {
56            if mutable_vars.iter().any(|v| v.name() == var.name()) {
57                continue;
58            }
59            println!("\t\t- {}", var);
60            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
61        }
62
63        // List UPS commands
64        println!("\t  Commands:");
65        for cmd in conn.list_commands(&name).await? {
66            let description = conn.get_command_description(&name, &cmd).await?;
67            println!("\t\t- {} ({})", cmd, description);
68        }
69    }
70
71    // Gracefully shut down the connection using the `LOGOUT` command
72    conn.close().await
73}
Source

pub fn with_host(self, host: Host) -> Self

Sets the connection host, such as the TCP address and port.

Examples found in repository?
examples/blocking.rs (line 20)
7fn main() -> nut_client::Result<()> {
8    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
9    let port = env::var("NUT_PORT")
10        .ok()
11        .map(|s| s.parse::<u16>().ok())
12        .flatten()
13        .unwrap_or(3493);
14
15    let username = env::var("NUT_USER").ok();
16    let password = env::var("NUT_PASSWORD").ok();
17    let auth = username.map(|username| Auth::new(username, password));
18
19    let config = ConfigBuilder::new()
20        .with_host((host, port).try_into().unwrap_or_default())
21        .with_auth(auth)
22        .with_debug(false) // Turn this on for debugging network chatter
23        .build();
24
25    let mut conn = Connection::new(&config)?;
26
27    // Get server information
28    println!("NUT server:");
29    println!("\tVersion: {}", conn.get_server_version()?);
30    println!("\tNetwork Version: {}", conn.get_network_version()?);
31
32    // Print a list of all UPS devices
33    println!("Connected UPS devices:");
34    for (name, description) in conn.list_ups()? {
35        println!("\t- Name: {}", name);
36        println!("\t  Description: {}", description);
37        println!("\t  Number of logins: {}", conn.get_num_logins(&name)?);
38
39        // Get list of mutable variables
40        let mutable_vars = conn.list_mutable_vars(&name)?;
41
42        // List UPS variables (key = val)
43        println!("\t  Mutable Variables:");
44        for var in mutable_vars.iter() {
45            println!("\t\t- {}", var);
46            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
47        }
48
49        // List UPS immutable properties (key = val)
50        println!("\t  Immutable Properties:");
51        for var in conn.list_vars(&name)? {
52            if mutable_vars.iter().any(|v| v.name() == var.name()) {
53                continue;
54            }
55            println!("\t\t- {}", var);
56            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
57        }
58
59        // List UPS commands
60        println!("\t  Commands:");
61        for cmd in conn.list_commands(&name)? {
62            let description = conn.get_command_description(&name, &cmd)?;
63            println!("\t\t- {} ({})", cmd, description);
64        }
65    }
66
67    // Gracefully shut down the connection using the `LOGOUT` command
68    conn.close()
69}
More examples
Hide additional examples
examples/async.rs (line 21)
8async fn main() -> nut_client::Result<()> {
9    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
10    let port = env::var("NUT_PORT")
11        .ok()
12        .map(|s| s.parse::<u16>().ok())
13        .flatten()
14        .unwrap_or(3493);
15
16    let username = env::var("NUT_USER").ok();
17    let password = env::var("NUT_PASSWORD").ok();
18    let auth = username.map(|username| Auth::new(username, password));
19
20    let config = ConfigBuilder::new()
21        .with_host((host, port).try_into().unwrap_or_default())
22        .with_auth(auth)
23        .with_debug(false) // Turn this on for debugging network chatter
24        .build();
25
26    let mut conn = Connection::new(&config).await?;
27
28    // Get server information
29    println!("NUT server:");
30    println!("\tVersion: {}", conn.get_server_version().await?);
31    println!("\tNetwork Version: {}", conn.get_network_version().await?);
32
33    // Print a list of all UPS devices
34    println!("Connected UPS devices:");
35    for (name, description) in conn.list_ups().await? {
36        println!("\t- Name: {}", name);
37        println!("\t  Description: {}", description);
38        println!(
39            "\t  Number of logins: {}",
40            conn.get_num_logins(&name).await?
41        );
42
43        // Get list of mutable variables
44        let mutable_vars = conn.list_mutable_vars(&name).await?;
45
46        // List UPS variables (key = val)
47        println!("\t  Mutable Variables:");
48        for var in mutable_vars.iter() {
49            println!("\t\t- {}", var);
50            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
51        }
52
53        // List UPS immutable properties (key = val)
54        println!("\t  Immutable Properties:");
55        for var in conn.list_vars(&name).await? {
56            if mutable_vars.iter().any(|v| v.name() == var.name()) {
57                continue;
58            }
59            println!("\t\t- {}", var);
60            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
61        }
62
63        // List UPS commands
64        println!("\t  Commands:");
65        for cmd in conn.list_commands(&name).await? {
66            let description = conn.get_command_description(&name, &cmd).await?;
67            println!("\t\t- {} ({})", cmd, description);
68        }
69    }
70
71    // Gracefully shut down the connection using the `LOGOUT` command
72    conn.close().await
73}
Source

pub fn with_auth(self, auth: Option<Auth>) -> Self

Sets the optional authentication parameters.

Examples found in repository?
examples/blocking.rs (line 21)
7fn main() -> nut_client::Result<()> {
8    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
9    let port = env::var("NUT_PORT")
10        .ok()
11        .map(|s| s.parse::<u16>().ok())
12        .flatten()
13        .unwrap_or(3493);
14
15    let username = env::var("NUT_USER").ok();
16    let password = env::var("NUT_PASSWORD").ok();
17    let auth = username.map(|username| Auth::new(username, password));
18
19    let config = ConfigBuilder::new()
20        .with_host((host, port).try_into().unwrap_or_default())
21        .with_auth(auth)
22        .with_debug(false) // Turn this on for debugging network chatter
23        .build();
24
25    let mut conn = Connection::new(&config)?;
26
27    // Get server information
28    println!("NUT server:");
29    println!("\tVersion: {}", conn.get_server_version()?);
30    println!("\tNetwork Version: {}", conn.get_network_version()?);
31
32    // Print a list of all UPS devices
33    println!("Connected UPS devices:");
34    for (name, description) in conn.list_ups()? {
35        println!("\t- Name: {}", name);
36        println!("\t  Description: {}", description);
37        println!("\t  Number of logins: {}", conn.get_num_logins(&name)?);
38
39        // Get list of mutable variables
40        let mutable_vars = conn.list_mutable_vars(&name)?;
41
42        // List UPS variables (key = val)
43        println!("\t  Mutable Variables:");
44        for var in mutable_vars.iter() {
45            println!("\t\t- {}", var);
46            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
47        }
48
49        // List UPS immutable properties (key = val)
50        println!("\t  Immutable Properties:");
51        for var in conn.list_vars(&name)? {
52            if mutable_vars.iter().any(|v| v.name() == var.name()) {
53                continue;
54            }
55            println!("\t\t- {}", var);
56            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
57        }
58
59        // List UPS commands
60        println!("\t  Commands:");
61        for cmd in conn.list_commands(&name)? {
62            let description = conn.get_command_description(&name, &cmd)?;
63            println!("\t\t- {} ({})", cmd, description);
64        }
65    }
66
67    // Gracefully shut down the connection using the `LOGOUT` command
68    conn.close()
69}
More examples
Hide additional examples
examples/async.rs (line 22)
8async fn main() -> nut_client::Result<()> {
9    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
10    let port = env::var("NUT_PORT")
11        .ok()
12        .map(|s| s.parse::<u16>().ok())
13        .flatten()
14        .unwrap_or(3493);
15
16    let username = env::var("NUT_USER").ok();
17    let password = env::var("NUT_PASSWORD").ok();
18    let auth = username.map(|username| Auth::new(username, password));
19
20    let config = ConfigBuilder::new()
21        .with_host((host, port).try_into().unwrap_or_default())
22        .with_auth(auth)
23        .with_debug(false) // Turn this on for debugging network chatter
24        .build();
25
26    let mut conn = Connection::new(&config).await?;
27
28    // Get server information
29    println!("NUT server:");
30    println!("\tVersion: {}", conn.get_server_version().await?);
31    println!("\tNetwork Version: {}", conn.get_network_version().await?);
32
33    // Print a list of all UPS devices
34    println!("Connected UPS devices:");
35    for (name, description) in conn.list_ups().await? {
36        println!("\t- Name: {}", name);
37        println!("\t  Description: {}", description);
38        println!(
39            "\t  Number of logins: {}",
40            conn.get_num_logins(&name).await?
41        );
42
43        // Get list of mutable variables
44        let mutable_vars = conn.list_mutable_vars(&name).await?;
45
46        // List UPS variables (key = val)
47        println!("\t  Mutable Variables:");
48        for var in mutable_vars.iter() {
49            println!("\t\t- {}", var);
50            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
51        }
52
53        // List UPS immutable properties (key = val)
54        println!("\t  Immutable Properties:");
55        for var in conn.list_vars(&name).await? {
56            if mutable_vars.iter().any(|v| v.name() == var.name()) {
57                continue;
58            }
59            println!("\t\t- {}", var);
60            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
61        }
62
63        // List UPS commands
64        println!("\t  Commands:");
65        for cmd in conn.list_commands(&name).await? {
66            let description = conn.get_command_description(&name, &cmd).await?;
67            println!("\t\t- {} ({})", cmd, description);
68        }
69    }
70
71    // Gracefully shut down the connection using the `LOGOUT` command
72    conn.close().await
73}
Source

pub fn with_timeout(self, timeout: Duration) -> Self

Sets the network connection timeout. This may be ignored by non-network connections, such as Unix domain sockets.

Source

pub fn with_ssl(self, ssl: bool) -> Self

Enables SSL on the connection.

This will enable strict SSL verification (including hostname), unless .with_insecure_ssl is also set to true.

Source

pub fn with_insecure_ssl(self, ssl_insecure: bool) -> Self

Turns off SSL verification.

Note: you must still use .with_ssl(true) to turn on SSL.

Source

pub fn with_debug(self, debug: bool) -> Self

Enables debugging network calls by printing to stderr.

Examples found in repository?
examples/blocking.rs (line 22)
7fn main() -> nut_client::Result<()> {
8    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
9    let port = env::var("NUT_PORT")
10        .ok()
11        .map(|s| s.parse::<u16>().ok())
12        .flatten()
13        .unwrap_or(3493);
14
15    let username = env::var("NUT_USER").ok();
16    let password = env::var("NUT_PASSWORD").ok();
17    let auth = username.map(|username| Auth::new(username, password));
18
19    let config = ConfigBuilder::new()
20        .with_host((host, port).try_into().unwrap_or_default())
21        .with_auth(auth)
22        .with_debug(false) // Turn this on for debugging network chatter
23        .build();
24
25    let mut conn = Connection::new(&config)?;
26
27    // Get server information
28    println!("NUT server:");
29    println!("\tVersion: {}", conn.get_server_version()?);
30    println!("\tNetwork Version: {}", conn.get_network_version()?);
31
32    // Print a list of all UPS devices
33    println!("Connected UPS devices:");
34    for (name, description) in conn.list_ups()? {
35        println!("\t- Name: {}", name);
36        println!("\t  Description: {}", description);
37        println!("\t  Number of logins: {}", conn.get_num_logins(&name)?);
38
39        // Get list of mutable variables
40        let mutable_vars = conn.list_mutable_vars(&name)?;
41
42        // List UPS variables (key = val)
43        println!("\t  Mutable Variables:");
44        for var in mutable_vars.iter() {
45            println!("\t\t- {}", var);
46            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
47        }
48
49        // List UPS immutable properties (key = val)
50        println!("\t  Immutable Properties:");
51        for var in conn.list_vars(&name)? {
52            if mutable_vars.iter().any(|v| v.name() == var.name()) {
53                continue;
54            }
55            println!("\t\t- {}", var);
56            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
57        }
58
59        // List UPS commands
60        println!("\t  Commands:");
61        for cmd in conn.list_commands(&name)? {
62            let description = conn.get_command_description(&name, &cmd)?;
63            println!("\t\t- {} ({})", cmd, description);
64        }
65    }
66
67    // Gracefully shut down the connection using the `LOGOUT` command
68    conn.close()
69}
More examples
Hide additional examples
examples/async.rs (line 23)
8async fn main() -> nut_client::Result<()> {
9    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
10    let port = env::var("NUT_PORT")
11        .ok()
12        .map(|s| s.parse::<u16>().ok())
13        .flatten()
14        .unwrap_or(3493);
15
16    let username = env::var("NUT_USER").ok();
17    let password = env::var("NUT_PASSWORD").ok();
18    let auth = username.map(|username| Auth::new(username, password));
19
20    let config = ConfigBuilder::new()
21        .with_host((host, port).try_into().unwrap_or_default())
22        .with_auth(auth)
23        .with_debug(false) // Turn this on for debugging network chatter
24        .build();
25
26    let mut conn = Connection::new(&config).await?;
27
28    // Get server information
29    println!("NUT server:");
30    println!("\tVersion: {}", conn.get_server_version().await?);
31    println!("\tNetwork Version: {}", conn.get_network_version().await?);
32
33    // Print a list of all UPS devices
34    println!("Connected UPS devices:");
35    for (name, description) in conn.list_ups().await? {
36        println!("\t- Name: {}", name);
37        println!("\t  Description: {}", description);
38        println!(
39            "\t  Number of logins: {}",
40            conn.get_num_logins(&name).await?
41        );
42
43        // Get list of mutable variables
44        let mutable_vars = conn.list_mutable_vars(&name).await?;
45
46        // List UPS variables (key = val)
47        println!("\t  Mutable Variables:");
48        for var in mutable_vars.iter() {
49            println!("\t\t- {}", var);
50            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
51        }
52
53        // List UPS immutable properties (key = val)
54        println!("\t  Immutable Properties:");
55        for var in conn.list_vars(&name).await? {
56            if mutable_vars.iter().any(|v| v.name() == var.name()) {
57                continue;
58            }
59            println!("\t\t- {}", var);
60            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
61        }
62
63        // List UPS commands
64        println!("\t  Commands:");
65        for cmd in conn.list_commands(&name).await? {
66            let description = conn.get_command_description(&name, &cmd).await?;
67            println!("\t\t- {} ({})", cmd, description);
68        }
69    }
70
71    // Gracefully shut down the connection using the `LOGOUT` command
72    conn.close().await
73}
Source

pub fn build(self) -> Config

Builds the configuration with this builder.

Examples found in repository?
examples/blocking.rs (line 23)
7fn main() -> nut_client::Result<()> {
8    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
9    let port = env::var("NUT_PORT")
10        .ok()
11        .map(|s| s.parse::<u16>().ok())
12        .flatten()
13        .unwrap_or(3493);
14
15    let username = env::var("NUT_USER").ok();
16    let password = env::var("NUT_PASSWORD").ok();
17    let auth = username.map(|username| Auth::new(username, password));
18
19    let config = ConfigBuilder::new()
20        .with_host((host, port).try_into().unwrap_or_default())
21        .with_auth(auth)
22        .with_debug(false) // Turn this on for debugging network chatter
23        .build();
24
25    let mut conn = Connection::new(&config)?;
26
27    // Get server information
28    println!("NUT server:");
29    println!("\tVersion: {}", conn.get_server_version()?);
30    println!("\tNetwork Version: {}", conn.get_network_version()?);
31
32    // Print a list of all UPS devices
33    println!("Connected UPS devices:");
34    for (name, description) in conn.list_ups()? {
35        println!("\t- Name: {}", name);
36        println!("\t  Description: {}", description);
37        println!("\t  Number of logins: {}", conn.get_num_logins(&name)?);
38
39        // Get list of mutable variables
40        let mutable_vars = conn.list_mutable_vars(&name)?;
41
42        // List UPS variables (key = val)
43        println!("\t  Mutable Variables:");
44        for var in mutable_vars.iter() {
45            println!("\t\t- {}", var);
46            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
47        }
48
49        // List UPS immutable properties (key = val)
50        println!("\t  Immutable Properties:");
51        for var in conn.list_vars(&name)? {
52            if mutable_vars.iter().any(|v| v.name() == var.name()) {
53                continue;
54            }
55            println!("\t\t- {}", var);
56            println!("\t\t  {:?}", conn.get_var_type(&name, var.name())?);
57        }
58
59        // List UPS commands
60        println!("\t  Commands:");
61        for cmd in conn.list_commands(&name)? {
62            let description = conn.get_command_description(&name, &cmd)?;
63            println!("\t\t- {} ({})", cmd, description);
64        }
65    }
66
67    // Gracefully shut down the connection using the `LOGOUT` command
68    conn.close()
69}
More examples
Hide additional examples
examples/async.rs (line 24)
8async fn main() -> nut_client::Result<()> {
9    let host = env::var("NUT_HOST").unwrap_or_else(|_| "localhost".into());
10    let port = env::var("NUT_PORT")
11        .ok()
12        .map(|s| s.parse::<u16>().ok())
13        .flatten()
14        .unwrap_or(3493);
15
16    let username = env::var("NUT_USER").ok();
17    let password = env::var("NUT_PASSWORD").ok();
18    let auth = username.map(|username| Auth::new(username, password));
19
20    let config = ConfigBuilder::new()
21        .with_host((host, port).try_into().unwrap_or_default())
22        .with_auth(auth)
23        .with_debug(false) // Turn this on for debugging network chatter
24        .build();
25
26    let mut conn = Connection::new(&config).await?;
27
28    // Get server information
29    println!("NUT server:");
30    println!("\tVersion: {}", conn.get_server_version().await?);
31    println!("\tNetwork Version: {}", conn.get_network_version().await?);
32
33    // Print a list of all UPS devices
34    println!("Connected UPS devices:");
35    for (name, description) in conn.list_ups().await? {
36        println!("\t- Name: {}", name);
37        println!("\t  Description: {}", description);
38        println!(
39            "\t  Number of logins: {}",
40            conn.get_num_logins(&name).await?
41        );
42
43        // Get list of mutable variables
44        let mutable_vars = conn.list_mutable_vars(&name).await?;
45
46        // List UPS variables (key = val)
47        println!("\t  Mutable Variables:");
48        for var in mutable_vars.iter() {
49            println!("\t\t- {}", var);
50            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
51        }
52
53        // List UPS immutable properties (key = val)
54        println!("\t  Immutable Properties:");
55        for var in conn.list_vars(&name).await? {
56            if mutable_vars.iter().any(|v| v.name() == var.name()) {
57                continue;
58            }
59            println!("\t\t- {}", var);
60            println!("\t\t  {:?}", conn.get_var_type(&name, var.name()).await?);
61        }
62
63        // List UPS commands
64        println!("\t  Commands:");
65        for cmd in conn.list_commands(&name).await? {
66            let description = conn.get_command_description(&name, &cmd).await?;
67            println!("\t\t- {} ({})", cmd, description);
68        }
69    }
70
71    // Gracefully shut down the connection using the `LOGOUT` command
72    conn.close().await
73}

Trait Implementations§

Source§

impl Clone for ConfigBuilder

Source§

fn clone(&self) -> ConfigBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ConfigBuilder

Source§

fn default() -> ConfigBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.