pub struct HostCandidate { /* private fields */ }Expand description
One completion candidate: the endpoint local data knows about.
token() renders exactly what can be typed after ssh://; the
constructor is pure and admissible() is judged by the address
grammar alone.
Implementations§
Source§impl HostCandidate
impl HostCandidate
pub fn new( host: String, user: Option<String>, port: Option<NonZeroU16>, origin: CandidateOrigin, ) -> Self
pub fn host(&self) -> &str
pub fn user(&self) -> Option<&str>
pub fn port(&self) -> Option<NonZeroU16>
pub fn origin(&self) -> CandidateOrigin
Sourcepub fn token(&self) -> String
pub fn token(&self) -> String
The endpoint as typed into an ssh:// URI (user@host:port,
IPv6 bracketed). Display spelling of identity data.
Sourcepub fn admissible(&self) -> bool
pub fn admissible(&self) -> bool
True when the one address grammar admits this endpoint. This is the only validity notion in the crate — there is no local re-implementation of hostname rules.
Sourcepub fn matches_typed(&self, typed: &str) -> Option<String>
pub fn matches_typed(&self, typed: &str) -> Option<String>
The completed endpoint token for a typed prefix, or None when
this candidate does not extend what the user typed. Typing a
user wins over a configured one; typing past : must extend
the candidate’s port, never reset it.
Trait Implementations§
Source§impl Clone for HostCandidate
impl Clone for HostCandidate
Source§fn clone(&self) -> HostCandidate
fn clone(&self) -> HostCandidate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HostCandidate
impl Debug for HostCandidate
impl Eq for HostCandidate
Source§impl PartialEq for HostCandidate
impl PartialEq for HostCandidate
impl StructuralPartialEq for HostCandidate
Auto Trait Implementations§
impl Freeze for HostCandidate
impl RefUnwindSafe for HostCandidate
impl Send for HostCandidate
impl Sync for HostCandidate
impl Unpin for HostCandidate
impl UnsafeUnpin for HostCandidate
impl UnwindSafe for HostCandidate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more