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.
Methods
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