Struct kvarn::vary::Settings

source ·
pub struct Settings { /* private fields */ }
Expand description

The rules for handling and caching a request/response.

Implementations§

Returns an empty set of rules. Will not cache any variants, except compressed.

Add a custom rule.

The request_header is used when outputting the vary header and for the internal cache.

transformation takes request_header and (hopefully, for performance) narrows the variants down to a finite number.

Prefer to return a limited set of strings from the transformation to minimize cache size. If you generate Strings, limit the amount of different strings.

If you have a large set or infinitely many variants outputted by transformation, the cache will suffer. Consider disabling the cache for the files affected by this rule to improve performance.

Panics

Will panic if the request_header contains invalid bytes. All of the bytes must satisfy b >= 32 && b < 127 || b == b'\t' where b is a byte. See utils::is_valid_header_value_byte.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. 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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more