Struct goose_eggs::Header[][src]

pub struct Header<'a> { /* fields omitted */ }
Expand description

Used to validate that headers are included in the server response.

Example

use goose_eggs::Header;

fn example() {
    // Validate that the "x-varnish" header is set.
    let _header = Header::name("x-varnish");
}

Implementations

Create a new Header validation struct by specifying all fields.

Example

use goose_eggs::Header;

let _header = Header::new("foo", Some("bar"));

Create a Header object to validate that a named header is set.

Example

use goose_eggs::Header;

// Create a Header object to validate that the "foo" header is set in the Response.
let _header = Header::name("foo");

Create a Header object to validate that a named header contains a specific value.

Example

use goose_eggs::Header;

// Create a Header object to validate that the "foo" header is set and contains "bar"
// in the Response.
let _header = Header::name_value("foo", "bar");

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

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

Performs the conversion.

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

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.