Expand description
Host-testable application runtime for RustFerry applications.
Platform crates install a Runtime containing concrete backend implementations.
Application code normally uses the capability modules and imports common types from
prelude. Unit tests can use testing::TestRuntime without a mobile SDK.
§Example
use rustferry::prelude::*;
use rustferry::testing::TestRuntime;
let runtime = TestRuntime::new();
let _runtime = runtime.enter();
runtime.set_network_status(NetworkStatus::online(NetworkTransport::Wifi));
assert!(network::is_online()?);
haptics::selection()?;
assert_eq!(runtime.haptic_calls().len(), 1);Re-exports§
pub use app_events as events;pub use app_events as lifecycle;pub use system as platform;
Modules§
- app_
events - Application lifecycle and typed event delivery.
- clipboard
- System clipboard text access.
- deep_
links - Parsing, allowlisting, and delivery of deep links.
- haptics
- Cross-platform haptic feedback.
- live_
activity - Live Activity state transport with graceful support detection.
- network
- Network-path monitoring and explicit backend probes.
- notifications
- Local notification scheduling, inspection, and cancellation.
- permissions
- Explicit runtime permission queries and requests.
- prelude
- Common runtime types for application code.
- share
- Native system share-sheet requests.
- storage
- Small serde-based key/value storage.
- system
- Application, device, theme, URL, and settings integration.
- testing
- Deterministic in-memory runtime for application unit tests.
- widgets
- A deliberately constrained snapshot model for platform widgets.
Structs§
- Runtime
- Active capability backend, storage backend, and event dispatcher.
- Runtime
Builder - Builder for a
Runtime. - Runtime
Guard - Restores the previous thread-scoped runtime when dropped.
Enums§
Constants§
- VERSION
- Exact runtime package version selected by Cargo.
Traits§
- Platform
Backend - Safe object-safe interface implemented by a generated platform bridge.
Functions§
- spawn
- Run an independent
Sendfuture on a worker thread. - supports
- Whether the active runtime has a concrete implementation for
operation.
Type Aliases§
- Result
- Result returned by runtime operations.