Skip to main content

Widget

Struct Widget 

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

One compiled, typed widget.

Implementations§

Source§

impl Widget

Source

pub fn parse(platform: Platform, f: &ItemFn) -> Result<Self>

Parses a declaration and rejects runtime UI and unsupported field expressions.

Source

pub fn rust_function(&self, f: ItemFn) -> TokenStream

Produces the Rust function that validates field types and serializes the model for the host.

Source

pub fn name(&self) -> String

The Rust declaration name, also used as the platform type name.

Source

pub fn platform(&self) -> Platform

The target of the generated source.

Source

pub fn source(&self, android_package: &str) -> Result<String>

Emits a complete Swift widget or Kotlin widget and receiver.

Source

pub fn android_resources( &self, android_package: &str, ) -> Result<Vec<(String, String)>>

Android manifest and provider resources for the compiled receiver.

Auto Trait Implementations§

§

impl !Send for Widget

§

impl !Sync for Widget

§

impl Forget for Widget

§

impl Freeze for Widget

§

impl Move for Widget

§

impl RefUnwindSafe for Widget

§

impl Unpin for Widget

§

impl UnsafeUnpin for Widget

§

impl UnwindSafe for Widget

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> 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, 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.