pub struct Resolved { /* private fields */ }
Expand description
A Resolved message is a successful reply to a Resolve message.
The Resolved message contains a list of zero or more addresses, and their associated times-to-live in seconds.
Implementations§
source§impl Resolved
impl Resolved
sourcepub fn new_err(transient: bool, ttl: u32) -> Self
pub fn new_err(transient: bool, ttl: u32) -> Self
Return a new Resolved object reporting a name lookup error.
TODO: Is getting no answer an error; or it is represented by a list of no answers?
sourcepub fn add_answer(&mut self, answer: ResolvedVal, ttl: u32)
pub fn add_answer(&mut self, answer: ResolvedVal, ttl: u32)
Add a single answer to this Resolved message
sourcepub fn into_answers(self) -> Vec<(ResolvedVal, u32)>
pub fn into_answers(self) -> Vec<(ResolvedVal, u32)>
Consume this Resolved message, returning a vector of the answers and TTL values that it contains.
Note that actually relying on these TTL values can be dangerous in practice, since the relay that sent the cell could be lying in order to cause more lookups, or to get a false answer cached for longer.
Trait Implementations§
source§impl Body for Resolved
impl Body for Resolved
source§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a relay cell body from a provided reader.
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Encode the body of this cell into the end of a writer.
source§impl From<Resolved> for AnyRelayMsg
impl From<Resolved> for AnyRelayMsg
source§fn from(m: Resolved) -> AnyRelayMsg
fn from(m: Resolved) -> AnyRelayMsg
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Resolved
impl RefUnwindSafe for Resolved
impl Send for Resolved
impl Sync for Resolved
impl Unpin for Resolved
impl UnwindSafe for Resolved
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