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
[src]
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 Hash for Name
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl Clone for Name
[src]
fn clone(&self) -> Name
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Eq for Name
[src]
impl PartialEq for Name
[src]
fn eq(&self, __arg_0: &Name) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Name) -> bool
This method tests for !=
.
impl Debug for Name
[src]
impl BinSerializable<Name> for Name
[src]
fn read(decoder: &mut BinDecoder) -> DecodeResult<Name>
parses the chain of labels this has a max of 255 octets, with each label being less than 63. all names will be stored lowercase internally. This will consume the portions of the Vec which it is reading...
fn emit(&self, encoder: &mut BinEncoder) -> EncodeResult
impl Display for Name
[src]
impl Index<usize> for Name
[src]
type Output = String
The returned type after indexing
fn index<'a>(&'a self, _index: usize) -> &'a String
The method for the indexing (Foo[Bar]
) operation
impl PartialOrd<Name> for Name
[src]
fn partial_cmp(&self, other: &Name) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more