Struct distant_core::DistantSingleKeyCredentials
source · [−]pub struct DistantSingleKeyCredentials {
pub host: String,
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: Stringport: u16key: SecretKey32username: Option<String>Implementations
sourceimpl DistantSingleKeyCredentials
impl DistantSingleKeyCredentials
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},
failing if the credentials would not produce a valid Destination
sourcepub fn try_to_uri(&self) -> Result<URI<'static>>
pub fn try_to_uri(&self) -> Result<URI<'static>>
sourcepub fn try_from_uri_ref<'a, E>(
uri_ref: impl TryInto<URIReference<'a>, Error = E>,
require_scheme: bool
) -> Result<Self> where
E: Error + Send + Sync + 'static,
pub fn try_from_uri_ref<'a, E>(
uri_ref: impl TryInto<URIReference<'a>, Error = E>,
require_scheme: bool
) -> Result<Self> where
E: Error + Send + Sync + 'static,
Parses credentials from a URIReference, failing if the input was not a valid
URIReference or if required parameters like host or password are missing or bad
format
If require_scheme is true, will enforce that a scheme is provided. Regardless, if a
scheme is provided that is not distant, this will also fail
Trait Implementations
sourceimpl Clone for DistantSingleKeyCredentials
impl Clone for DistantSingleKeyCredentials
sourcefn clone(&self) -> DistantSingleKeyCredentials
fn clone(&self) -> DistantSingleKeyCredentials
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for DistantSingleKeyCredentials
impl Debug for DistantSingleKeyCredentials
sourceimpl<'de> Deserialize<'de> for DistantSingleKeyCredentials
impl<'de> Deserialize<'de> for DistantSingleKeyCredentials
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Display for DistantSingleKeyCredentials
impl Display for DistantSingleKeyCredentials
sourceimpl FromStr for DistantSingleKeyCredentials
impl FromStr for DistantSingleKeyCredentials
sourcefn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse distant://[username]:{key}@{host} 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
sourceimpl PartialEq<DistantSingleKeyCredentials> for DistantSingleKeyCredentials
impl PartialEq<DistantSingleKeyCredentials> for DistantSingleKeyCredentials
sourcefn eq(&self, other: &DistantSingleKeyCredentials) -> bool
fn eq(&self, other: &DistantSingleKeyCredentials) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &DistantSingleKeyCredentials) -> bool
fn ne(&self, other: &DistantSingleKeyCredentials) -> bool
This method tests for !=.
impl Eq for DistantSingleKeyCredentials
impl StructuralEq for DistantSingleKeyCredentials
impl StructuralPartialEq for DistantSingleKeyCredentials
Auto Trait Implementations
impl RefUnwindSafe for DistantSingleKeyCredentials
impl Send for DistantSingleKeyCredentials
impl Sync for DistantSingleKeyCredentials
impl Unpin for DistantSingleKeyCredentials
impl UnwindSafe for DistantSingleKeyCredentials
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more