pub struct SourceMap { /* private fields */ }
Expand description

Links to a file that maps transformed source to the original source.

MDN Documentation

Specifications

Examples

use http_types::{Response, Url};
use http_types::other::SourceMap;

let source_map = SourceMap::new(Url::parse("https://example.net/")?);

let mut res = Response::new(200);
source_map.apply(&mut res);

let base_url = Url::parse("https://example.net/")?;
let source_map = SourceMap::from_headers(base_url, res)?.unwrap();
assert_eq!(source_map.location(), &Url::parse("https://example.net/")?);

Implementations

Create a new instance of SourceMap header.

Create a new instance from headers.

Sets the header.

Get the HeaderName.

Get the HeaderValue.

Get the url.

Set the url.

Trait Implementations

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

Returns the argument unchanged.

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 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.