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
sourceimpl 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
sourceimpl Body for Resolved
impl Body for Resolved
sourcefn into_message(self) -> RelayMsg
fn into_message(self) -> RelayMsg
Convert this type into a RelayMsg, wrapped appropriate.
sourcefn 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.
sourcefn encode_onto(self, w: &mut Vec<u8>)
fn encode_onto(self, w: &mut Vec<u8>)
Encode the body of this cell into the end of a vec.
Auto Trait Implementations
impl RefUnwindSafe for Resolved
impl Send for Resolved
impl Sync for Resolved
impl Unpin for Resolved
impl UnwindSafe for Resolved
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more