Struct Http

Source
pub struct Http { /* private fields */ }
Expand description

Fields related to HTTP activity. Use the url field set to store the url of the request.

Implementations§

Source§

impl Http

Source

pub fn get_request_id(&self) -> Option<&String>

A unique identifier for each HTTP request to correlate logs between clients and servers in transactions.

The id may be contained in a non-standard HTTP header, such as X-Request-ID or X-Correlation-ID.

Source

pub fn set_request_id(&mut self, request_id_arg: String)

A unique identifier for each HTTP request to correlate logs between clients and servers in transactions.

The id may be contained in a non-standard HTTP header, such as X-Request-ID or X-Correlation-ID.

§Example

123e4567-e89b-12d3-a456-426614174000

Source

pub fn get_request_method(&self) -> Option<&String>

HTTP request method.

The value should retain its casing from the original event. For example, GET, get, and GeT are all considered valid values for this field.

Source

pub fn set_request_method(&mut self, request_method_arg: String)

HTTP request method.

The value should retain its casing from the original event. For example, GET, get, and GeT are all considered valid values for this field.

§Example

POST

Source

pub fn get_request_mime_type(&self) -> Option<&String>

Mime type of the body of the request.

This value must only be populated based on the content of the request body, not on the Content-Type header. Comparing the mime type of a request with the request’s Content-Type header can be helpful in detecting threats or misconfigured clients.

Source

pub fn set_request_mime_type(&mut self, request_mime_type_arg: String)

Mime type of the body of the request.

This value must only be populated based on the content of the request body, not on the Content-Type header. Comparing the mime type of a request with the request’s Content-Type header can be helpful in detecting threats or misconfigured clients.

§Example

image/gif

Source

pub fn get_request_body_content(&self) -> Option<&String>

The full HTTP request body.

Source

pub fn set_request_body_content(&mut self, request_body_content_arg: String)

The full HTTP request body.

§Example

Hello world

Source

pub fn get_request_referrer(&self) -> Option<&String>

Referrer for this HTTP request.

Source

pub fn set_request_referrer(&mut self, request_referrer_arg: String)

Referrer for this HTTP request.

§Example

https://blog.example.com/

Source

pub fn get_response_status_code(&self) -> Option<&u64>

HTTP response status code.

Source

pub fn set_response_status_code(&mut self, response_status_code_arg: u64)

HTTP response status code.

§Example

404

Source

pub fn get_response_mime_type(&self) -> Option<&String>

Mime type of the body of the response.

This value must only be populated based on the content of the response body, not on the Content-Type header. Comparing the mime type of a response with the response’s Content-Type header can be helpful in detecting misconfigured servers.

Source

pub fn set_response_mime_type(&mut self, response_mime_type_arg: String)

Mime type of the body of the response.

This value must only be populated based on the content of the response body, not on the Content-Type header. Comparing the mime type of a response with the response’s Content-Type header can be helpful in detecting misconfigured servers.

§Example

image/gif

Source

pub fn get_response_body_content(&self) -> Option<&String>

The full HTTP response body.

Source

pub fn set_response_body_content(&mut self, response_body_content_arg: String)

The full HTTP response body.

§Example

Hello world

Source

pub fn get_version(&self) -> Option<&String>

HTTP version.

Source

pub fn set_version(&mut self, version_arg: String)

HTTP version.

§Example

1.1

Source

pub fn get_request_bytes(&self) -> Option<&u64>

Total size in bytes of the request (body and headers).

Source

pub fn set_request_bytes(&mut self, request_bytes_arg: u64)

Total size in bytes of the request (body and headers).

§Example

1437

Source

pub fn get_request_body_bytes(&self) -> Option<&u64>

Size in bytes of the request body.

Source

pub fn set_request_body_bytes(&mut self, request_body_bytes_arg: u64)

Size in bytes of the request body.

§Example

887

Source

pub fn get_response_bytes(&self) -> Option<&u64>

Total size in bytes of the response (body and headers).

Source

pub fn set_response_bytes(&mut self, response_bytes_arg: u64)

Total size in bytes of the response (body and headers).

§Example

1437

Source

pub fn get_response_body_bytes(&self) -> Option<&u64>

Size in bytes of the response body.

Source

pub fn set_response_body_bytes(&mut self, response_body_bytes_arg: u64)

Size in bytes of the response body.

§Example

887

Trait Implementations§

Source§

impl Clone for Http

Source§

fn clone(&self) -> Http

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 Default for Http

Source§

fn default() -> Http

Returns the “default value” for a type. Read more
Source§

impl Serialize for Http

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Http

§

impl RefUnwindSafe for Http

§

impl Send for Http

§

impl Sync for Http

§

impl Unpin for Http

§

impl UnwindSafe for Http

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.