pub trait AppRuntime:
Send
+ Sync
+ MediaInteraction
+ MediaRuntime
+ Network
+ PopupPresenter
+ Device
+ DeviceHardware
+ SecureStore
+ FileInteraction
+ Location
+ UIUpdate
+ UpdateService
+ UserFeedback
+ Wifi
+ 'static {
// Required methods
fn read_asset<'a>(
&'a self,
path: &str,
) -> Result<Box<dyn Read + 'a>, PlatformError>;
fn asset_dir_iter<'a>(
&'a self,
asset_dir: &str,
) -> Box<dyn Iterator<Item = Result<AssetFileEntry<'a>, PlatformError>> + 'a>;
fn app_data_dir(&self) -> PathBuf;
fn app_cache_dir(&self) -> PathBuf;
fn get_app_identifier(&self) -> Result<String, PlatformError>;
fn get_system_locale(&self) -> &str;
fn show_lxapp(
&self,
appid: String,
path: String,
session_id: u64,
presentation: LxAppPresentation,
panel_id: String,
) -> Result<(), PlatformError>;
fn hide_lxapp(
&self,
appid: String,
session_id: u64,
) -> Result<(), PlatformError>;
fn navigate(
&self,
appid: String,
path: String,
animation_type: AnimationType,
) -> Result<(), PlatformError>;
fn open_url(&self, req: OpenUrlRequest) -> Result<(), PlatformError>;
fn get_capsule_rect(
&self,
) -> impl Future<Output = Result<String, PlatformError>> + Send;
// Provided method
fn copy_album_media_to_file(
&self,
uri: &str,
dest_path: &Path,
kind: MediaKind,
) -> Result<(), PlatformError> { ... }
}Required Methods§
Sourcefn read_asset<'a>(
&'a self,
path: &str,
) -> Result<Box<dyn Read + 'a>, PlatformError>
fn read_asset<'a>( &'a self, path: &str, ) -> Result<Box<dyn Read + 'a>, PlatformError>
Reads an asset file as a streaming reader.
Sourcefn asset_dir_iter<'a>(
&'a self,
asset_dir: &str,
) -> Box<dyn Iterator<Item = Result<AssetFileEntry<'a>, PlatformError>> + 'a>
fn asset_dir_iter<'a>( &'a self, asset_dir: &str, ) -> Box<dyn Iterator<Item = Result<AssetFileEntry<'a>, PlatformError>> + 'a>
Iterates over files in an asset directory.
Sourcefn app_data_dir(&self) -> PathBuf
fn app_data_dir(&self) -> PathBuf
Returns the app’s data directory path.
Sourcefn app_cache_dir(&self) -> PathBuf
fn app_cache_dir(&self) -> PathBuf
Returns the app’s cache directory path.
Sourcefn get_app_identifier(&self) -> Result<String, PlatformError>
fn get_app_identifier(&self) -> Result<String, PlatformError>
Obtains the application identifier.
Sourcefn get_system_locale(&self) -> &str
fn get_system_locale(&self) -> &str
Returns the current system locale.
Sourcefn show_lxapp(
&self,
appid: String,
path: String,
session_id: u64,
presentation: LxAppPresentation,
panel_id: String,
) -> Result<(), PlatformError>
fn show_lxapp( &self, appid: String, path: String, session_id: u64, presentation: LxAppPresentation, panel_id: String, ) -> Result<(), PlatformError>
Show the UI container for the given LxApp and route.
Sourcefn hide_lxapp(
&self,
appid: String,
session_id: u64,
) -> Result<(), PlatformError>
fn hide_lxapp( &self, appid: String, session_id: u64, ) -> Result<(), PlatformError>
Hide the UI container for the given LxApp (does not destroy its runtime state).
Navigates within the given LxApp using an animation.
Sourcefn open_url(&self, req: OpenUrlRequest) -> Result<(), PlatformError>
fn open_url(&self, req: OpenUrlRequest) -> Result<(), PlatformError>
Opens the given URL according to the host policy for the requested target.
Sourcefn get_capsule_rect(
&self,
) -> impl Future<Output = Result<String, PlatformError>> + Send
fn get_capsule_rect( &self, ) -> impl Future<Output = Result<String, PlatformError>> + Send
Gets the capsule button bounding rect in screen coordinates. Returns JSON: {“width”: f64, “height”: f64, “top”: f64, “right”: f64, “bottom”: f64, “left”: f64}
Provided Methods§
Sourcefn copy_album_media_to_file(
&self,
uri: &str,
dest_path: &Path,
kind: MediaKind,
) -> Result<(), PlatformError>
fn copy_album_media_to_file( &self, uri: &str, dest_path: &Path, kind: MediaKind, ) -> Result<(), PlatformError>
Copies media from the system album to a local file.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.