Skip to main content

PlatformViewView

Struct PlatformViewView 

Source
pub struct PlatformViewView { /* private fields */ }
Expand description

A declarative platform-view slot. See the module docs.

Implementations§

Source§

impl PlatformViewView

Source

pub fn params_json(self, params_json: impl Into<String>) -> Self

Set the opaque creation params handed to the native factory (default empty). Changing this across a rebuild bumps the widget’s retained params_generation counter exactly once (see the module’s Identity notes) — the differ uses the bump to decide whether to re-create or merely update the native view.

Source

pub fn size(self, width: f64, height: f64) -> Self

Force an explicit (width, height) slot size, clamped into whatever constraints this widget’s parent hands it. Overrides PlatformViewView::expand when called after it (last builder call wins, matching the crate’s other size-mode builders).

Source

pub fn expand(self) -> Self

Fill the incoming constraints’ maximum — the default (see [SlotSize::Expand]), provided as an explicit builder call for readability at call sites that want to make the choice visible.

Source

pub fn debug_fill(self) -> Self

Debug aid: paint a translucent magenta slab over the slot’s bounds (see [DEBUG_FILL_COLOR]) so the reserved region is visible even with no native host attached — invaluable on desktop, where a platform view never actually composites. Compiled only into debug builds, so it can never ship live in a release binary.

Source

pub fn semantics_label(self, label: impl Into<String>) -> Self

Attach a plain accessible label over the slot’s bounds (a Role::GenericContainer semantics node) — the v1 accessibility-gap mitigation: the native view itself carries no frust-visible semantics, so this is the only signal an assistive technology gets for the region.

Source

pub fn interactive(self) -> Self

Mode B input forwarding: mark this slot’s native view as pointer-interactive. A touch-DOWN inside the slot’s rect — and outside every shield rect (Self::shield_local) — hands the whole gesture to the native sibling instead of the frust surface. Default off (the v1 no-input contract).

Source

pub fn shield_local(self, rect: Rect) -> Self

Declare a slot-relative region where frust content drawn OVER this slot must keep receiving input (the z-shield).

The manual escape hatch, not the ordinary path. Wrap the frust chrome in shield instead: a shield(child) reports the rect it actually painted every frame, so it can’t drift out of sync with a moving/resizing widget the way a hand-written rect does. Reach for this builder only for a region no widget paints (a reserved gutter, a gesture-only zone). Both sources are honored — the shell-side differ unions a slot’s manual rects with the intersecting auto-collected ones.

The rect is slot-relative; the widget translates it into absolute window coordinates when it publishes its frame.

Trait Implementations§

Source§

impl<State: 'static> View<State> for PlatformViewView

Source§

type Element = PlatformViewWidget

The retained widget this view produces.
Source§

fn build(&self, _ctx: &mut BuildCtx<'_>) -> PlatformViewWidget

Materialise a fresh widget for this view.
Source§

fn rebuild( &self, prev: &Self, element: &mut PlatformViewWidget, _ctx: &mut BuildCtx<'_>, ) -> ChangeFlags

Reconcile prev (the previous view of the same type) against the live element, mutating it in place and reporting what changed.
Source§

fn teardown(&self, element: &mut PlatformViewWidget, _ctx: &mut BuildCtx<'_>)

Tear down element when this view is being removed. Read more
Source§

fn message(&self, _element: &mut Self::Element, _state: &mut State)

Deliver an event message to this view, mutating application state. Read more

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

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

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.