Skip to main content

TextureView

Struct TextureView 

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

A declarative view of an externally rendered scene texture. See the module docs.

Implementations§

Source§

impl TextureView

Source

pub fn fit(self, fit: TextureFit) -> Self

How the texture is placed in the box. Needs Self::source_size to keep an aspect ratio; without it every fit fills the box.

Source

pub fn source_size(self, size: Size) -> Self

The texture’s own extent (a video’s resolution), which fit keeps the aspect ratio of. Only the ratio matters.

Source

pub fn size(self, size: Size) -> Self

A fixed size, clamped into the parent’s constraints. Overrides Self::expand when called after it.

Source

pub fn expand(self) -> Self

Fill the parent’s maximum constraints — the default.

Source

pub fn corner_radius(self, radius: f64) -> Self

Clip the box to corners of radius; 0.0 (the default) is square.

Source

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

An accessible label, contributing a Role::Image semantics node; an unlabelled texture view is decorative and reports nothing.

Trait Implementations§

Source§

impl Clone for TextureView

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TextureView

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TextureView

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TextureView

Source§

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

Source§

type Element = TextureWidget

The retained widget this view produces.
Source§

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

Materialise a fresh widget for this view.
Source§

fn rebuild( &self, prev: &Self, element: &mut TextureWidget, _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 Self::Element, _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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<State, V> ViewSeq<State, One> for V
where State: 'static, V: View<State>,

Source§

fn extend_views(self, out: &mut Vec<AnyView<State>>)

Push every element of this sequence, in order, onto out — erasing each with AnyView::new (a no-op for an element already an AnyView).