pub struct TreeCompressor<Target> { /* private fields */ }
Expand description

A domain name compressor that uses a tree.

This type wraps around an octets builder and implements domain name compression for it. It stores the position of any domain name it has seen in a binary tree.

The position of a domain name is calculated relative to the beginning of the underlying octets builder. This means that this builder must represent the message only. This means that if you are using the StreamTarget, you need to place it inside this type, not the other way around.

Implementations

Creates a new compressor from an underlying octets builder.

Returns a reference to the underlying octets builder.

Converts the compressor into the underlying octets builder.

Returns an octets slice of the data.

Returns an mutable octets slice of the data.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The type of the octets the builder can be converted into. Read more

Appends the content of a slice to the builder. Read more

Truncates the builder back to a length of len octets.

Appends a domain name using name compression if supported. Read more

Converts the builder into immutable octets.

Returns the length of the already assembled data.

Returns whether the builder is currently empty.

Appends all data or nothing. Read more

Prepends some appended data with its length as a u16. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.