Struct domain::bits::charstr::CharStrBuf[][src]

pub struct CharStrBuf { /* fields omitted */ }

An owned, mutable DNS character string.

This type adds the methods push(), extend_from_slice(), and extend_from_str() to the methods from CharStr and [u8] to which it derefs (transitively). Note that the Extend trait is not implemented since adding data to a character string may fail if the string would become too long.

In addition through the usual suspects, values can be created from strings via the FromStr trait as well as by parsing from master file data through the scan() function.

Methods

impl CharStrBuf
[src]

Creates a new character string using the given vec.

Returns Some(_) if the vector was at most 255 long or None otherwise.

Creates a new empty character string.

Scans a new character string from master data.

Trades the character string for its raw bytes vector.

impl CharStrBuf
[src]

Appends an octet to the end of the character string.

The method will fail if there isn’t room for additional data.

Extends the character string with the contents of a bytes slice.

The method will fail if there isn’t room for adding the complete contents of the slice.

Extends the character string with the contents of a Rust string.

The string must contain the master data representation of a character string either as a regular word without white-space or a single quoted entity. If the string cannot be converted, the function fails with the appropriate error. If adding the resulting data would exceed the length limit of the character string, the method fails with FromStrError::LongString.

Methods from Deref<Target = CharStr>

Returns a reference to the character string’s data.

Returns an owned version of the character string.

Returns the length of the character string’s data in bytes.

Returns whether the character string’s data is empty.

Composes a character string.

Trait Implementations

impl Clone for CharStrBuf
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for CharStrBuf
[src]

Returns the "default value" for a type. Read more

impl<'a> From<&'a CharStr> for CharStrBuf
[src]

Performs the conversion.

impl FromStr for CharStrBuf
[src]

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

impl Deref for CharStrBuf
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for CharStrBuf
[src]

Mutably dereferences the value.

impl Borrow<CharStr> for CharStrBuf
[src]

Immutably borrows from an owned value. Read more

impl Borrow<[u8]> for CharStrBuf
[src]

Immutably borrows from an owned value. Read more

impl AsRef<CharStr> for CharStrBuf
[src]

Performs the conversion.

impl AsRef<[u8]> for CharStrBuf
[src]

Performs the conversion.

impl<C: AsRef<CharStr>> PartialEq<C> for CharStrBuf
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for CharStrBuf
[src]

impl<C: AsRef<CharStr>> PartialOrd<C> for CharStrBuf
[src]

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Ord for CharStrBuf
[src]

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl Hash for CharStrBuf
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl Display for CharStrBuf
[src]

Formats the value using the given formatter. Read more

impl Debug for CharStrBuf
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for CharStrBuf

impl Sync for CharStrBuf