Struct trust_dns::rr::domain::Name [] [src]

pub struct Name {
    // some fields omitted

TODO: all Names should be stored in a global "intern" space, and then everything that uses them should be through references. As a workaround the Strings are all Rc as well as the array TODO: Currently this probably doesn't support binary names, it would be nice to do that.


impl Name

fn new() -> Self

fn root() -> Self

fn is_root(&self) -> bool

fn label(self, label: &'static str) -> Self

inline builder

fn with_labels(labels: Vec<String>) -> Self

for mutating over time

fn prepend_label(&self, label: Rc<String>) -> Self

prepend the String to the label

fn add_label(&mut self, label: Rc<String>) -> &mut Self

appends the String to this label at the end

fn append(&mut self, other: &Self) -> &mut Self

appends the other to this name

fn base_name(&self) -> Name

Trims off the first part of the name, to help with searching for the domain piece

fn zone_of(&self, name: &Self) -> bool

returns true if the name components of self are all present at the end of name

fn num_labels(&self) -> u8

fn len(&self) -> usize

returns the length in bytes of the labels. '.' counts as 1

fn parse(local: &str, origin: Option<&Self>) -> ParseResult<Self>

fn emit_as_canonical(&self, encoder: &mut BinEncoder, canonical: bool) -> EncodeResult

Trait Implementations

impl BinSerializable<Name> for Name

fn read(decoder: &mut BinDecoder) -> DecodeResult<Name>

fn emit(&self, encoder: &mut BinEncoder) -> EncodeResult

impl Display for Name

fn fmt(&self, f: &mut Formatter) -> Result

impl Index<usize> for Name

type Output = String

fn index<'a>(&'a self, _index: usize) -> &'a String

impl PartialOrd<Name> for Name

fn partial_cmp(&self, other: &Name) -> Option<Ordering>

1.0.0fn lt(&self, other: &Rhs) -> bool

1.0.0fn le(&self, other: &Rhs) -> bool

1.0.0fn gt(&self, other: &Rhs) -> bool

1.0.0fn ge(&self, other: &Rhs) -> bool

impl Ord for Name

fn cmp(&self, other: &Self) -> Ordering

Derived Implementations

impl Hash for Name

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

1.3.0fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl Clone for Name

fn clone(&self) -> Name

1.0.0fn clone_from(&mut self, source: &Self)

impl Eq for Name

impl PartialEq for Name

fn eq(&self, __arg_0: &Name) -> bool

fn ne(&self, __arg_0: &Name) -> bool

impl Debug for Name

fn fmt(&self, __arg_0: &mut Formatter) -> Result