Struct tor_linkspec::TransportId
source · pub struct TransportId(_);Expand description
Identify a type of Transport.
If this crate is compiled with the pt-client feature, this type can
support pluggable transports; otherwise, only the built-in transport type is
supported.
This can be displayed as, or parsed from, a string.
"-" is used to indicate the builtin transport,
and "" and "bridge" and "<none>" are also recognised for that.
Implementations§
source§impl TransportId
impl TransportId
sourcepub fn new_builtin() -> Self
pub fn new_builtin() -> Self
Return a new TransportId referencing the builtin transport
This is equivalent to the Default impl.
sourcepub fn new_pluggable(pt: PtTransportName) -> Self
Available on crate feature pt-client only.
pub fn new_pluggable(pt: PtTransportName) -> Self
pt-client only.Return a new TransportId referencing a pluggable transport
This is equivalent to the From<PtTransportName> impl.
sourcepub fn is_builtin(&self) -> bool
pub fn is_builtin(&self) -> bool
Return true if this is the built-in transport.
sourcepub fn as_pluggable(&self) -> Option<&PtTransportName>
Available on crate feature pt-client only.
pub fn as_pluggable(&self) -> Option<&PtTransportName>
pt-client only.Returns the pluggable transport name
Or None if self doesn’t specify a pluggable transport
(e.g. if it specifies the builtin transport).
sourcepub fn into_pluggable(self) -> Option<PtTransportName>
Available on crate feature pt-client only.
pub fn into_pluggable(self) -> Option<PtTransportName>
pt-client only.Consumes this TransportId and returns the pluggable transport name
Or None if self doesn’t specify a pluggable transport
(e.g. if it specifies the builtin transport).
Trait Implementations§
source§impl Clone for TransportId
impl Clone for TransportId
source§fn clone(&self) -> TransportId
fn clone(&self) -> TransportId
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for TransportId
impl Debug for TransportId
source§impl Default for TransportId
impl Default for TransportId
source§fn default() -> TransportId
fn default() -> TransportId
source§impl Display for TransportId
impl Display for TransportId
source§impl From<PtTransportName> for TransportId
Available on crate feature pt-client only.
impl From<PtTransportName> for TransportId
pt-client only.source§fn from(name: PtTransportName) -> Self
fn from(name: PtTransportName) -> Self
source§impl FromStr for TransportId
impl FromStr for TransportId
source§impl Hash for TransportId
impl Hash for TransportId
source§impl PartialEq<TransportId> for TransportId
impl PartialEq<TransportId> for TransportId
source§fn eq(&self, other: &TransportId) -> bool
fn eq(&self, other: &TransportId) -> bool
self and other values to be equal, and is used
by ==.impl Eq for TransportId
impl StructuralEq for TransportId
impl StructuralPartialEq for TransportId
Auto Trait Implementations§
impl RefUnwindSafe for TransportId
impl Send for TransportId
impl Sync for TransportId
impl Unpin for TransportId
impl UnwindSafe for TransportId
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.