Skip to main content

ResourceRequest

Struct ResourceRequest 

Source
pub struct ResourceRequest { /* private fields */ }

Implementations§

Source§

impl ResourceRequest

Source

pub fn new(raw: *mut ArkWeb_ResourceRequest) -> Self

Source

pub fn raw(&self) -> *mut ArkWeb_ResourceRequest

Returns the underlying native ArkWeb_ResourceRequest pointer.

Source

pub fn as_id(&self) -> usize

Returns the numeric address of the native ArkWeb_ResourceRequest handle, suitable for correlating the same request across on_request_start and on_request_stop.

Source

pub fn set_user_token(&self, token: usize) -> Result<(), ArkWebError>

Stores an opaque integer token on the native ArkWeb_ResourceRequest via OH_ArkWebResourceRequest_SetUserData.

Source

pub fn user_token(&self) -> usize

Reads back the integer token previously stored with Self::set_user_token (0 if unset).

Source

pub unsafe fn set_user_data( &self, user_data: *mut c_void, ) -> Result<(), ArkWebError>

Attaches a raw user_data pointer to this native ArkWeb_ResourceRequest via OH_ArkWebResourceRequest_SetUserData.

§Safety

Callers that later dereference Self::user_data must ensure user_data remains valid and properly aligned for that access.

Source

pub fn user_data(&self) -> *mut c_void

Returns the raw user_data pointer attached to this native ArkWeb_ResourceRequest via OH_ArkWebResourceRequest_GetUserData.

Source

pub fn http_body_stream(&self) -> Option<HttpBodyStream>

Obtain an owned body stream on the ArkWeb I/O thread. Reads initialize automatically; use initialize first if metadata is needed before reading.

Source

pub fn frame_url(&self) -> String

Source

pub fn method(&self) -> String

Source

pub fn referrer(&self) -> String

Source

pub fn resource_type(&self) -> ResourceType

Source

pub fn url(&self) -> String

Get the url of the request

Source

pub fn headers(&self) -> HashMap<String, String>

Get all headers of the request

Source

pub fn has_gesture(&self) -> bool

Source

pub fn is_main_frame(&self) -> bool

Source

pub fn is_redirect(&self) -> bool

Trait Implementations§

Source§

impl Debug for ResourceRequest

Source§

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

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

impl Eq for ResourceRequest

Source§

impl Hash for ResourceRequest

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 PartialEq for ResourceRequest

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ResourceRequest

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.