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

A domain name compressor that doesn’t require an allocator.

This type wraps around an octets builder and implements domain name compression. It does not require an allocator but because of that it can only remember the position of up to 24 domain names. This should be sufficient for most messages.

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 static compressor from an octets builder.

Returns a reference to the underlying octets builder.

Converts the static compressor into the underlying octets builder.

Returns a reference to the octets slice of the content.

Returns a reference to the octets slice of the content.

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.