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: HttpStatus,
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: HttpStatus
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.
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more