pub struct Target {
pub url: Url,
pub username: Option<String>,
pub fingerprint: Option<Fingerprint>,
}Expand description
The device to connect to, with everything but the password.
Fields§
§url: UrlThe TR-064 address.
username: Option<String>The user on the device.
fingerprint: Option<Fingerprint>The fingerprint of the trusted certificate.
Implementations§
Source§impl Target
impl Target
Sourcepub fn resolve(
profile: Option<&Profile>,
overrides: &Overrides,
) -> Result<Self, Error>
pub fn resolve( profile: Option<&Profile>, overrides: &Overrides, ) -> Result<Self, Error>
Combines a profile with the overrides. Without either, the target is
DEFAULT_HOST.
The user of the profile applies only to the host of the profile, also over another scheme or port; its certificate only to the same address. Neither applies to another host given as an override.
Sourcepub fn username(&self) -> Result<&str, Error>
pub fn username(&self) -> Result<&str, Error>
The user for TR-064, or PASSWORD_ONLY_USERNAME if none is set.
§Errors
None; the result is kept for compatibility.
Sourcepub fn web_username(&self) -> &str
pub fn web_username(&self) -> &str
The user for the login to the web interface, empty if none is set, as the web interface expects for devices with only a password.
Sourcepub fn account(&self) -> Result<String, Error>
pub fn account(&self) -> Result<String, Error>
The name of the password in the keychain: user@host, or the host
alone if no user is set.
§Errors
None; the result is kept for compatibility.
Sourcepub fn web(&self) -> Self
pub fn web(&self) -> Self
The web interface of the device, which serves the session login and
the REST API: the TR-064 ports 49443 and 49000 become the default
ports of https and http, other addresses stay as they are. The
device uses the same certificate for both.
Sourcepub fn client(&self) -> Result<ClientBuilder, Error>
pub fn client(&self) -> Result<ClientBuilder, Error>
A client builder for the device, with the certificate pinned for
https and the log redacted by redact::Log. Without credentials,
which only actions need.