Skip to main content

RuntimeHandleDiscarding

Struct RuntimeHandleDiscarding 

Source
pub struct RuntimeHandleDiscarding<'a>(/* private fields */);
Expand description

Submits RuntimeHandle commands without a completion. Each call returns the same acceptance status as its completing form, and native logs a command that later fails as a warning through the log handler.

Implementations§

Source§

impl RuntimeHandleDiscarding<'_>

Source

pub fn clear_event_handler(&self) -> Result<()>

Stops sending the events of the runtime and its maps to a callback.

See mln_runtime_clear_event_handler in the C API reference.

Source

pub fn clear_http_header_transform(&self) -> Result<()>

Stops adding headers to the runtime’s HTTP requests.

See mln_runtime_clear_http_header_transform in the C API reference.

Source

pub fn clear_resource_provider(&self) -> Result<()>

Removes the runtime’s resource provider, so the library loads every request itself.

See mln_runtime_clear_resource_provider in the C API reference.

Source

pub fn clear_resource_transform(&self) -> Result<()>

Stops rewriting the URLs of the runtime’s network requests.

See mln_runtime_clear_resource_transform in the C API reference.

Source

pub fn set_event_handler(&self, handler: RuntimeEventHandler) -> Result<()>

Sends the events of the runtime and its maps to a callback.

The callback replaces the one set before.

See mln_runtime_set_event_handler in the C API reference.

Source

pub fn set_http_header_transform( &self, transform: HttpHeaderTransform, ) -> Result<()>

Adds headers to the runtime’s HTTP requests.

The transform replaces the one set before. In a browser or on OpenHarmony, serve the requests with RuntimeHandle::set_resource_provider() instead.

Runs on a library thread.

See mln_runtime_set_http_header_transform in the C API reference.

§Errors
  • Status::Unsupported when the library runs in a browser or on OpenHarmony.
Source

pub fn set_resource_provider(&self, provider: ResourceProvider) -> Result<()>

Serves the runtime’s network requests through a callback.

The provider receives the network requests that its routes match, and the library loads the rest as usual. A provider can serve URL schemes that the library can’t load itself. The provider replaces the one set before.

See mln_runtime_set_resource_provider in the C API reference.

Source

pub fn set_resource_transform(&self, transform: ResourceTransform) -> Result<()>

Rewrites the URLs of the runtime’s network requests.

The transform replaces the one set before.

See mln_runtime_set_resource_transform in the C API reference.

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
§

impl<T> ErasedDestructor for T
where T: 'static,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
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.