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.