Struct tor_linkspec::EncodedLinkSpec
source · pub struct EncodedLinkSpec { /* private fields */ }
Expand description
An unparsed piece of information about a relay and how to connect to it.
Unlike LinkSpec
, this can’t be used directly; we only pass it on.
Implementations§
source§impl EncodedLinkSpec
impl EncodedLinkSpec
sourcepub fn new(lstype: LinkSpecType, body: impl Into<Vec<u8>>) -> Self
pub fn new(lstype: LinkSpecType, body: impl Into<Vec<u8>>) -> Self
Create a new EncodedLinkSpec
.
sourcepub fn parse(&self) -> Result<LinkSpec>
pub fn parse(&self) -> Result<LinkSpec>
Try to parse this into a LinkSpec
, if it appears well-formed.
sourcepub fn lstype(&self) -> LinkSpecType
pub fn lstype(&self) -> LinkSpecType
Return the link spec type for this EncodedLinkSpec
.
Trait Implementations§
source§impl Clone for EncodedLinkSpec
impl Clone for EncodedLinkSpec
source§fn clone(&self) -> EncodedLinkSpec
fn clone(&self) -> EncodedLinkSpec
Returns a copy of the value. Read more
1.0.0 · 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 EncodedLinkSpec
impl Debug for EncodedLinkSpec
source§impl PartialEq for EncodedLinkSpec
impl PartialEq for EncodedLinkSpec
source§fn eq(&self, other: &EncodedLinkSpec) -> bool
fn eq(&self, other: &EncodedLinkSpec) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Readable for EncodedLinkSpec
impl Readable for EncodedLinkSpec
source§impl Writeable for EncodedLinkSpec
impl Writeable for EncodedLinkSpec
source§fn write_onto<B: Writer + ?Sized>(&self, w: &mut B) -> EncodeResult<()>
fn write_onto<B: Writer + ?Sized>(&self, w: &mut B) -> EncodeResult<()>
Encode this object into the writer
b
.impl Eq for EncodedLinkSpec
impl StructuralPartialEq for EncodedLinkSpec
Auto Trait Implementations§
impl Freeze for EncodedLinkSpec
impl RefUnwindSafe for EncodedLinkSpec
impl Send for EncodedLinkSpec
impl Sync for EncodedLinkSpec
impl Unpin for EncodedLinkSpec
impl UnwindSafe for EncodedLinkSpec
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
source§impl<W> WriteableOnce for Wwhere
W: Writeable,
impl<W> WriteableOnce for Wwhere
W: Writeable,
source§fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>
Encode this object into the writer
b
, and consume it.