Struct net_traits::Metadata
source · pub struct Metadata {
pub final_url: ServoUrl,
pub location_url: Option<Result<ServoUrl, String>>,
pub content_type: Option<Serde<ContentType>>,
pub charset: Option<String>,
pub headers: Option<Serde<HeaderMap>>,
pub status: Option<(u16, Vec<u8>)>,
pub https_state: HttpsState,
pub referrer: Option<ServoUrl>,
pub referrer_policy: Option<ReferrerPolicy>,
pub timing: Option<ResourceFetchTiming>,
pub redirected: bool,
}
Expand description
Metadata about a loaded resource, such as is obtained from HTTP headers.
Fields§
§final_url: ServoUrl
Final URL after redirects.
location_url: Option<Result<ServoUrl, String>>
Location URL from the response headers.
content_type: Option<Serde<ContentType>>
MIME type / subtype.
charset: Option<String>
Character set.
headers: Option<Serde<HeaderMap>>
Headers
status: Option<(u16, Vec<u8>)>
HTTP Status
https_state: HttpsState
Is successful HTTPS connection
referrer: Option<ServoUrl>
Referrer Url
referrer_policy: Option<ReferrerPolicy>
Referrer Policy of the Request used to obtain Response
timing: Option<ResourceFetchTiming>
Performance information for navigation events
redirected: bool
True if the request comes from a redirection
Implementations§
source§impl Metadata
impl Metadata
sourcepub fn set_content_type(&mut self, content_type: Option<&Mime>)
pub fn set_content_type(&mut self, content_type: Option<&Mime>)
Extract the parts of a Mime that we care about.
sourcepub fn set_referrer_policy(&mut self, referrer_policy: Option<ReferrerPolicy>)
pub fn set_referrer_policy(&mut self, referrer_policy: Option<ReferrerPolicy>)
Set the referrer policy associated with the loaded resource.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl MallocSizeOf for Metadata
impl MallocSizeOf for Metadata
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.