pub struct WebView<T = ()> {
Show 15 fields pub is_handle: bool, pub objc: ObjcProperty, pub layer: Layer, pub objc_delegate: Option<ShareId<Object>>, pub delegate: Option<Box<T>>, pub top: LayoutAnchorY, pub leading: LayoutAnchorX, pub left: LayoutAnchorX, pub trailing: LayoutAnchorX, pub right: LayoutAnchorX, pub bottom: LayoutAnchorY, pub width: LayoutAnchorDimension, pub height: LayoutAnchorDimension, pub center_x: LayoutAnchorX, pub center_y: LayoutAnchorY,
}
Available on crate feature webview only.

Fields

is_handle: bool

An internal flag for whether an instance of a View is a handle. Typically, there’s only one instance that should have this set to false - if that one drops, we need to know to do some extra cleanup.

objc: ObjcProperty

A pointer to the Objective-C runtime view controller.

layer: Layer

A reference to the underlying CALayer.

objc_delegate: Option<ShareId<Object>>

We need to store the underlying delegate separately from the WKWebView - this is a where we do so.

delegate: Option<Box<T>>

A pointer to the delegate for this view.

top: LayoutAnchorY

A pointer to the Objective-C runtime top layout constraint.

leading: LayoutAnchorX

A pointer to the Objective-C runtime leading layout constraint.

left: LayoutAnchorX

A pointer to the Objective-C runtime left layout constraint.

trailing: LayoutAnchorX

A pointer to the Objective-C runtime trailing layout constraint.

right: LayoutAnchorX

A pointer to the Objective-C runtime right layout constraint.

bottom: LayoutAnchorY

A pointer to the Objective-C runtime bottom layout constraint.

width: LayoutAnchorDimension

A pointer to the Objective-C runtime width layout constraint.

height: LayoutAnchorDimension

A pointer to the Objective-C runtime height layout constraint.

center_x: LayoutAnchorX

A pointer to the Objective-C runtime center X layout constraint.

center_y: LayoutAnchorY

A pointer to the Objective-C runtime center Y layout constraint.

Implementations

Returns a default WebView, suitable for customizing and displaying.

Initializes a new WebView with a given WebViewDelegate. This enables you to respond to events and customize the view as a module, similar to class-based systems.

Given a URL, instructs the WebView to load it.

Given a HTML string, instructs the WebView to load it. Useful for small html files, but often better to use custom protocol.

Go back in history, if possible.

Go forward in history, if possible.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

A bit of extra cleanup for delegate callback pointers.

Currently, this is a noop. Theoretically there is reason to support this, but in practice I’ve never seen it needed… but am open to discussion.

Sets whether this needs to be redrawn before being displayed. Read more

Removes a control or view from the superview.

Sets the frame for the view this trait is applied to. Read more

Sets whether the view for this trait should translate autoresizing masks into layout constraints. Read more

Sets whether the view for this is hidden or not. Read more

Returns whether this is hidden or not. Read more

Returns whether this is hidden, or whether an ancestor view is hidden.

Register this view for drag and drop operations. Read more

Unregisters this as a target for drag and drop operations. Read more

Sets whether this posts notifications when the frame rectangle changes. Read more

Sets whether this posts notifications when the bounds rectangle changes. Read more

Theoretically this belongs elsewhere, but we want to enable this on all view layers, since it’s common enough anyway. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.