Backend

Trait Backend 

Source
pub trait Backend:
    Sized
    + Send
    + Sync {
    const DEFAULT_PATH: &'static str;

    // Required methods
    fn path(&self) -> &Path;
    fn init(
        project: &Project,
    ) -> impl Future<Output = Result<Self, FailToInitBackend>> + Send;
}
Expand description

Trait for backends in a WaterUI project.

Required Associated Constants§

Source

const DEFAULT_PATH: &'static str

The default relative path for this backend (e.g., “android”, “apple”).

Required Methods§

Source

fn path(&self) -> &Path

Get the relative path for this backend instance.

This is relative to Backends::path().

Source

fn init( project: &Project, ) -> impl Future<Output = Result<Self, FailToInitBackend>> + Send

Initialize the backend for the given project.

Creates necessary files/folders for the backend at project.backend_path::<Self>(). Returns the initialized backend configuration.

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.

Implementors§

Source§

impl Backend for AndroidBackend

Source§

const DEFAULT_PATH: &'static str = "android"

Source§

impl Backend for AppleBackend

Source§

const DEFAULT_PATH: &'static str = "apple"