Struct soup::MessageMetrics

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

Contains metrics collected while loading a Message either from the network or the disk cache.

Metrics are not collected by default for a Message, you need to add the flag MessageFlags::COLLECT_METRICS to enable the feature.

Temporal metrics are expressed as a monotonic time and always start with a fetch start event and finish with response end. All other events are optional. An event can be 0 because it hasn’t happened yet, because it’s optional or because the load failed before the event reached.

Size metrics are expressed in bytes and are updated while the Message is being loaded. You can connect to different Message signals to get the final result of every value.

Implementations§

source§

impl MessageMetrics

source

pub fn as_ptr(&self) -> *mut SoupMessageMetrics

Return the inner pointer to the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow<'a>( ptr: *const *const SoupMessageMetrics ) -> &'a Self

Borrows the underlying C value.

source

pub unsafe fn from_glib_ptr_borrow_mut<'a>( ptr: *mut *mut SoupMessageMetrics ) -> &'a mut Self

Borrows the underlying C value mutably.

source§

impl MessageMetrics

source

pub fn connect_end(&mut self) -> u64

Get the time immediately after the Message completed the connection to the server. This includes the time for the proxy negotiation and TLS handshake.

It will be 0 if no network connection was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).

§Returns

the connection end time

source

pub fn connect_start(&mut self) -> u64

Get the time immediately before the Message started to establish the connection to the server.

It will be 0 if no network connection was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).

§Returns

the connection start time

source

pub fn dns_end(&mut self) -> u64

Get the time immediately after the Message completed the domain lookup name for the resource.

It will be 0 if no domain lookup was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).

§Returns

the domain lookup end time

source

pub fn dns_start(&mut self) -> u64

Get the time immediately before the Message started the domain lookup name for the resource.

It will be 0 if no domain lookup was required to fetch the resource (a persistent connection was used or resource was loaded from the local disk cache).

§Returns

the domain lookup start time

source

pub fn fetch_start(&mut self) -> u64

Get the time immediately before the Message started to fetch a resource either from a remote server or local disk cache.

§Returns

the fetch start time

source

pub fn request_body_bytes_sent(&mut self) -> u64

Get the number of bytes sent to the network for the request body.

This is the size of the body sent, after encodings are applied, so it might be greater than the value returned by request_body_size(). This value is available right before wrote-body signal is emitted, but you might get an intermediate value if called before.

§Returns

the request body bytes sent

source

pub fn request_body_size(&mut self) -> u64

Get the request body size in bytes. This is the size of the original body given to the request before any encoding is applied.

This value is available right before wrote-body signal is emitted, but you might get an intermediate value if called before.

§Returns

the request body size

source

pub fn request_header_bytes_sent(&mut self) -> u64

Get the number of bytes sent to the network for the request headers.

This value is available right before wrote-headers signal is emitted, but you might get an intermediate value if called before.

§Returns

the request headers bytes sent

source

pub fn request_start(&mut self) -> u64

Get the time immediately before the Message started the request of the resource from the server or the local disk cache.

§Returns

the request start time

source

pub fn response_body_bytes_received(&mut self) -> u64

Get the number of bytes received from the network for the response body.

This value is available right before got-body signal is emitted, but you might get an intermediate value if called before. For resources loaded from the disk cache this value is always 0.

§Returns

the response body bytes received

source

pub fn response_body_size(&mut self) -> u64

Get the response body size in bytes.

This is the size of the body as given to the user after all encodings are applied, so it might be greater than the value returned by response_body_bytes_received(). This value is available right before got-body signal is emitted, but you might get an intermediate value if called before.

§Returns

the response body size

source

pub fn response_end(&mut self) -> u64

Get the time immediately after the Message received the last bytes of the response from the server or the local disk cache.

In case of load failure, this returns the time immediately before the fetch is aborted.

§Returns

the response end time

source

pub fn response_header_bytes_received(&mut self) -> u64

Get the number of bytes received from the network for the response headers.

This value is available right before got-headers signal is emitted, but you might get an intermediate value if called before. For resources loaded from the disk cache this value is always 0.

§Returns

the response headers bytes received

source

pub fn response_start(&mut self) -> u64

Get the time immediately after the Message received the first bytes of the response from the server or the local disk cache.

§Returns

the response start time

source

pub fn tls_start(&mut self) -> u64

Get the time immediately before the Message started the TLS handshake.

It will be 0 if no TLS handshake was required to fetch the resource (connection was not secure, a persistent connection was used or resource was loaded from the local disk cache).

§Returns

the tls start time

Trait Implementations§

source§

impl Clone for MessageMetrics

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MessageMetrics

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<MessageMetrics> for Value

source§

fn from(o: MessageMetrics) -> Self

Converts to this type from the input type.
source§

impl HasParamSpec for MessageMetrics

§

type ParamSpec = ParamSpecBoxed

§

type SetValue = MessageMetrics

Preferred value to be used as setter for the associated ParamSpec.
§

type BuilderFn = fn(_: &str) -> ParamSpecBoxedBuilder<'_, MessageMetrics>

source§

fn param_spec_builder() -> Self::BuilderFn

source§

impl Hash for MessageMetrics

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for MessageMetrics

source§

fn cmp(&self, other: &MessageMetrics) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MessageMetrics

source§

fn eq(&self, other: &MessageMetrics) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MessageMetrics

source§

fn partial_cmp(&self, other: &MessageMetrics) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl StaticType for MessageMetrics

source§

fn static_type() -> Type

Returns the type identifier of Self.
source§

impl Eq for MessageMetrics

source§

impl StructuralPartialEq for MessageMetrics

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( _: *const GPtrArray, _: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GPtrArray, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *const GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(_: *const GSList, _: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GList, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec( ptr: *mut GPtrArray, num: usize ) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GPtrArray, num: usize) -> Vec<T>

source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_container_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

unsafe fn from_glib_full_num_as_vec(ptr: *mut GSList, num: usize) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(_: *const GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(_: *const GSList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GList) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GPtrArray) -> Vec<T>

source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

source§

unsafe fn from_glib_none_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_container_as_vec(ptr: *mut GSList) -> Vec<T>

source§

unsafe fn from_glib_full_as_vec(ptr: *mut GSList) -> Vec<T>

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> IntoClosureReturnValue for T
where T: Into<Value>,

source§

impl<T> Property for T
where T: HasParamSpec,

§

type Value = T

source§

impl<T> PropertyGet for T
where T: HasParamSpec,

§

type Value = T

source§

fn get<R, F>(&self, f: F) -> R
where F: Fn(&<T as PropertyGet>::Value) -> R,

source§

impl<T> StaticTypeExt for T
where T: StaticType,

source§

fn ensure_type()

Ensures that the type has been registered with the type system.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TransparentType for T

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T> TryFromClosureReturnValue for T
where T: for<'a> FromValue<'a> + StaticType + 'static,

source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<'a, T, C, E> FromValueOptional<'a> for T
where T: FromValue<'a, Checker = C>, C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError<E>>, E: Error + Send + 'static,