Skip to main content

MobileApp

Struct MobileApp 

Source
pub struct MobileApp<S: GlobalState, W>
where W: Clone + Into<Widget>,
{ /* private fields */ }

Implementations§

Source§

impl<S, W> MobileApp<S, W>
where S: GlobalState + Default, W: Clone + Into<Widget> + 'static,

Source

pub fn new(root_widget: W) -> Self

Source

pub fn new_with_global_state(root_widget: W, global_state: S) -> Self

Source

pub fn with_global_state(self, global_state: S) -> Self

Source

pub fn with_key_handler<F>(self, handler: F) -> Self
where F: Fn(&mut S, &KeyCode, u8) -> bool + Send + Sync + 'static,

Source

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

Source

pub fn with_test_control_port(self, port: u16) -> Self

Source

pub fn with_state_init<F>(self, init: F) -> Self
where F: FnOnce(&mut S),

Source

pub fn with_startup_action<A: Action>(self, action: A) -> Self

Source

pub fn with_design_system<D: DesignSystem>(self, mode: DesignMode) -> Self

Source

pub fn with_sync_env<F>(self, sync: F) -> Self
where F: Fn(&S, &mut Env) + Send + Sync + 'static,

Source

pub fn with_frame_hook<F>(self, hook: F) -> Self
where F: Fn(&mut S) -> bool + Send + Sync + 'static,

Source

pub fn with_async<F>(self, configure: F) -> Self
where F: FnOnce(&mut AsyncRegistry),

Source

pub fn with_notification_host<H>(self, host: H) -> Self

Source

pub fn with_nfc_host<H>(self, host: H) -> Self
where H: NfcHost,

Source

pub fn with_biometric_host<H>(self, host: H) -> Self
where H: BiometricHost,

Source

pub fn with_passkey_host<H>(self, host: H) -> Self
where H: PasskeyHost,

Source

pub fn with_bluetooth_host<H>(self, host: H) -> Self
where H: BluetoothHost,

Source

pub fn with_barcode_scanner_host<H>(self, host: H) -> Self

Source

pub fn with_camera_host<H>(self, host: H) -> Self
where H: CameraHost,

Source

pub fn with_clipboard_host<H>(self, host: H) -> Self
where H: ClipboardHost,

Source

pub fn with_geolocation_host<H>(self, host: H) -> Self
where H: GeolocationHost,

Source

pub fn with_haptic_host<H>(self, host: H) -> Self
where H: HapticHost,

Source

pub fn with_microphone_host<H>(self, host: H) -> Self
where H: MicrophoneHost,

Source

pub fn with_wifi_host<H>(self, host: H) -> Self
where H: WifiHost,

Source

pub fn with_volume_host<H>(self, host: H) -> Self
where H: VolumeHost,

Source

pub fn with_startup_notification_response( self, response: NotificationResponse, ) -> Self

Source

pub fn on_notification_response<H>(self, handler: H) -> Self

Source

pub fn absorb_registry(&mut self, registry: ActionRegistry<S>)

Source

pub fn run(self) -> Result<()>

Auto Trait Implementations§

§

impl<S, W> Freeze for MobileApp<S, W>
where W: Freeze,

§

impl<S, W> !RefUnwindSafe for MobileApp<S, W>

§

impl<S, W> Send for MobileApp<S, W>
where W: Send,

§

impl<S, W> !Sync for MobileApp<S, W>

§

impl<S, W> Unpin for MobileApp<S, W>
where W: Unpin, S: Unpin,

§

impl<S, W> UnsafeUnpin for MobileApp<S, W>
where W: UnsafeUnpin,

§

impl<S, W> !UnwindSafe for MobileApp<S, W>

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

Source§

fn downcast(&self) -> &T

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,