pub enum NativeProp {
Show 26 variants
Disabled(bool),
Source(WebSource),
Src(Option<Arc<str>>),
Poster(Option<Arc<str>>),
Html(Option<Arc<str>>),
BaseUrl(Option<Arc<str>>),
AllowOrigin(Option<Arc<str>>),
AllowNavigation(Option<Vec<Arc<str>>>),
InjectedJavaScript(Option<Arc<str>>),
InjectedJavaScriptBefore(Option<Arc<str>>),
UserAgent(Option<Arc<str>>),
Scrollable(bool),
JavaScriptEnabled(bool),
BackForwardGestures(bool),
Incognito(bool),
Zoomable(bool),
UrlSchemes(Vec<WebUrlScheme>),
Paused(bool),
Muted(bool),
Volume(f32),
Rate(f32),
Repeat(bool),
VideoResizeMode(ResizeMode),
Controls(bool),
ProgressInterval(f32),
AudioSession(AudioSession),
// some variants omitted
}Expand description
A property of a native control.
Variants§
Disabled(bool)
disabled (any element): ignores presses (no press feedback either),
applies disabled: classes, disables controls, and screen readers
say it is disabled (its accessibility state).
Source(WebSource)
What a web view or video loads, as Rust sets it (TS sets src,
html and baseUrl).
Src(Option<Arc<str>>)
src of a web view or video: the URL it loads.
Poster(Option<Arc<str>>)
poster (videos): an image shown until the video’s first frame is ready.
Html(Option<Arc<str>>)
html (web views): the page to show instead of loading src.
BaseUrl(Option<Arc<str>>)
baseUrl (web views): the URL the relative links of html
resolve against.
AllowOrigin(Option<Arc<str>>)
allowOrigin (web views): one more origin this web view may show and
navigate to besides webview.hosts, for an origin known only while
the app runs: scheme://host[:port], http or https, matched
exactly (crate::access::WebOrigin). It needs
"runtimeOrigin": true in capabilities.webview; another value or
no grant is refused with a message and the web view has none. Set
with src in the same render, it applies to that src; changed
later, it applies from the next navigation. Other web views and
the windows a page opens do not have it.
allowNavigation (web views): the hosts this web view may show and
navigate to, narrower than webview.hosts: the same host patterns
(*, *.example.com, a host name), and an empty list refuses every
web page (crate::access::WebHosts). The platform refuses any
other http or https page before its request is made and reports
onError with ERR_ACCESS_DENIED and the url. It never widens
the app’s grant. A list with a pattern that does not read is refused
with a message and the web view is not narrowed.
InjectedJavaScript(Option<Arc<str>>)
injectedJavaScript (web views): runs after each page loads.
InjectedJavaScriptBefore(Option<Arc<str>>)
injectedJavaScriptBeforeContentLoaded (web views): runs before each page’s
own scripts.
UserAgent(Option<Arc<str>>)
userAgent (web views): the browser’s user agent string.
Scrollable(bool)
scrollable: the user can scroll it (default true).
JavaScriptEnabled(bool)
javaScriptEnabled (web views): pages run scripts (default true).
BackForwardGestures(bool)
allowsBackForwardNavigationGestures (iOS web views; desktop ones on
macOS, with two-finger trackpad swipes): swipe back and forward.
Incognito(bool)
incognito (web views): the page’s website data (cookies, storage,
the cache) lives only as long as the web view, apart from the app’s
other web views; on Android, where every web view shares the app’s
cookies and storage, it loads without the HTTP cache and saves no
form data. Read when the web view is made; a later change is ignored
(with a warning): render a new element to change it.
Zoomable(bool)
zoomable (web views): the person can pinch to zoom the page, also
past the scale limits of its viewport (Android’s built-in zoom with
no on-screen buttons, WebKit ignoring the viewport’s scale limits on
iOS, magnification on macOS). False keeps each platform’s own
behavior: Android and macOS do not zoom, iOS zooms as far as the
page’s viewport allows, WebView2 (Windows) zooms by default. Read
when the web view is made, as incognito.
UrlSchemes(Vec<WebUrlScheme>)
The URL schemes a web view serves from the app (Rust’s
WebView::url_scheme). Read when the web view is made, as
incognito.
Paused(bool)
paused (videos): playback is paused.
Muted(bool)
muted (videos): no sound.
Volume(f32)
volume (videos): 0..1.
Rate(f32)
rate (videos): the playback speed.
Repeat(bool)
repeat (videos): plays again from the start at the end.
VideoResizeMode(ResizeMode)
How a video fits its box (objectFit, a Rust resize_mode).
Controls(bool)
controls (videos): the platform’s playback controls.
ProgressInterval(f32)
progressUpdateInterval (videos): milliseconds between onProgress events
(250 by default).
AudioSession(AudioSession)
audioSession (videos): what the sound does to the rest of the
device’s audio while it plays ("default" when unset: the app’s
audio settings).
Trait Implementations§
Source§impl Clone for NativeProp
impl Clone for NativeProp
Source§impl Debug for NativeProp
impl Debug for NativeProp
Source§impl HostProps for NativeProp
impl HostProps for NativeProp
Source§fn decode<I: HostInput>(
name: &str,
input: &I,
cx: &mut HostCx,
) -> Option<Option<Self>>
fn decode<I: HostInput>( name: &str, input: &I, cx: &mut HostCx, ) -> Option<Option<Self>>
name sets with input: None for a name that is
not one of these props, Some(None) when nothing is to be set.