pub unsafe trait WKURLSchemeHandler: NSObjectProtocol + MainThreadOnly {
// Provided methods
unsafe fn webView_startURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
where Self: Sized + Message { ... }
unsafe fn webView_stopURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
where Self: Sized + Message { ... }
}WKURLSchemeHandler only.Expand description
A class conforming to the WKURLSchemeHandler protocol provides methods for loading resources with URL schemes that WebKit doesn’t know how to handle itself.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn webView_startURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
Available on macOS and crate feature objc2-app-kit and crate feature WKURLSchemeTask and crate feature WKWebView only.
unsafe fn webView_startURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
objc2-app-kit and crate feature WKURLSchemeTask and crate feature WKWebView only.Notifies your app to start loading the data for a particular resource represented by the URL scheme handler task.
Parameter webView: The web view invoking the method.
Parameter urlSchemeTask: The task that your app should start loading data for.
Sourceunsafe fn webView_stopURLSchemeTask(
&self,
web_view: &WKWebView,
url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>,
)
Available on macOS and crate feature objc2-app-kit and crate feature WKURLSchemeTask and crate feature WKWebView only.
unsafe fn webView_stopURLSchemeTask( &self, web_view: &WKWebView, url_scheme_task: &ProtocolObject<dyn WKURLSchemeTask>, )
objc2-app-kit and crate feature WKURLSchemeTask and crate feature WKWebView only.Notifies your app to stop handling a URL scheme handler task.
Parameter webView: The web view invoking the method.
Parameter urlSchemeTask: The task that your app should stop handling.
After your app is told to stop loading data for a URL scheme handler task it must not perform any callbacks for that task. An exception will be thrown if any callbacks are made on the URL scheme handler task after your app has been told to stop loading for it.
Trait Implementations§
Source§impl ProtocolType for dyn WKURLSchemeHandler
impl ProtocolType for dyn WKURLSchemeHandler
impl<T> ImplementedBy<T> for dyn WKURLSchemeHandler
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".