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<'_>
impl RuntimeHandleDiscarding<'_>
Sourcepub fn clear_event_handler(&self) -> Result<()>
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.
Sourcepub fn clear_http_header_transform(&self) -> Result<()>
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.
Sourcepub fn clear_resource_provider(&self) -> Result<()>
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.
Sourcepub fn clear_resource_transform(&self) -> Result<()>
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.
Sourcepub fn set_event_handler(&self, handler: RuntimeEventHandler) -> Result<()>
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.
Sourcepub fn set_http_header_transform(
&self,
transform: HttpHeaderTransform,
) -> Result<()>
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::Unsupportedwhen the library runs in a browser or on OpenHarmony.
Sourcepub fn set_resource_provider(&self, provider: ResourceProvider) -> Result<()>
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.
Sourcepub fn set_resource_transform(&self, transform: ResourceTransform) -> Result<()>
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§
impl<'a> Freeze for RuntimeHandleDiscarding<'a>
impl<'a> RefUnwindSafe for RuntimeHandleDiscarding<'a>
impl<'a> Send for RuntimeHandleDiscarding<'a>
impl<'a> Sync for RuntimeHandleDiscarding<'a>
impl<'a> Unpin for RuntimeHandleDiscarding<'a>
impl<'a> UnsafeUnpin for RuntimeHandleDiscarding<'a>
impl<'a> UnwindSafe for RuntimeHandleDiscarding<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
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> ⓘ
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