pub struct DistantSingleKeyCredentials {
pub host: Host,
pub port: u16,
pub key: SecretKey32,
pub username: Option<String>,
}
Expand description
Represents credentials used for a distant server that is maintaining a single key across all connections
Fields§
§host: Host
§port: u16
§key: SecretKey32
§username: Option<String>
Implementations§
source§impl DistantSingleKeyCredentials
impl DistantSingleKeyCredentials
sourcepub fn find(s: &str, strict: bool) -> Option<DistantSingleKeyCredentials>
pub fn find(s: &str, strict: bool) -> Option<DistantSingleKeyCredentials>
Searches a str for distant://[username]:{key}@{host}:{port}
, returning the first matching
credentials set if found, failing if anything is found immediately before or after the
credentials that is not whitespace or control characters
If strict
is false, then the scheme can be preceded by any character
sourcepub fn find_strict(s: &str) -> Option<DistantSingleKeyCredentials>
pub fn find_strict(s: &str) -> Option<DistantSingleKeyCredentials>
Equivalent to find(s, true)
.
sourcepub fn find_lax(s: &str) -> Option<DistantSingleKeyCredentials>
pub fn find_lax(s: &str) -> Option<DistantSingleKeyCredentials>
Equivalent to find(s, false)
.
sourcepub fn try_to_destination(&self) -> Result<Destination>
pub fn try_to_destination(&self) -> Result<Destination>
Converts credentials into a Destination
of the form
distant://[username]:{key}@{host}:{port}
, failing if the credentials would not produce a
valid Destination
Trait Implementations§
source§impl Clone for DistantSingleKeyCredentials
impl Clone for DistantSingleKeyCredentials
source§fn clone(&self) -> DistantSingleKeyCredentials
fn clone(&self) -> DistantSingleKeyCredentials
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DistantSingleKeyCredentials
impl Debug for DistantSingleKeyCredentials
source§impl<'de> Deserialize<'de> for DistantSingleKeyCredentials
impl<'de> Deserialize<'de> for DistantSingleKeyCredentials
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where D: Deserializer<'de>,
source§impl FromStr for DistantSingleKeyCredentials
impl FromStr for DistantSingleKeyCredentials
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse distant://[username]:{key}@{host}:{port}
as credentials. Note that this requires the
distant
scheme to be included. If parsing without scheme is desired, call the
[DistantSingleKeyCredentials::try_from_uri_ref
] method instead with require_scheme
set to false
source§impl PartialEq<DistantSingleKeyCredentials> for DistantSingleKeyCredentials
impl PartialEq<DistantSingleKeyCredentials> for DistantSingleKeyCredentials
source§fn eq(&self, other: &DistantSingleKeyCredentials) -> bool
fn eq(&self, other: &DistantSingleKeyCredentials) -> bool
self
and other
values to be equal, and is used
by ==
.