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<EncodedLinkSpec> for EncodedLinkSpec
impl PartialEq<EncodedLinkSpec> 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 StructuralEq for EncodedLinkSpec
impl StructuralPartialEq for EncodedLinkSpec
Auto Trait Implementations§
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
§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
Checks if this value is equivalent to the given key. Read more
§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
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> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn 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>,
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>where
B: Writer + ?Sized,
fn write_into<B>(self, b: &mut B) -> Result<(), EncodeError>where B: Writer + ?Sized,
Encode this object into the writer
b, and consume it.