feat(engine): add platform abstraction trait skeleton (closes #47)
Adds solitaire_engine::platform::{StorageBackend, PlatformTime} traits.
No implementations yet — native and WASM impls follow in #48.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/// Abstracts platform-specific wall-clock time.
|
||||
///
|
||||
/// Native: backed by `std::time::SystemTime`.
|
||||
/// WASM: backed by `js_sys::Date::now()`.
|
||||
pub trait PlatformTime: Send + Sync + 'static {
|
||||
/// Returns the current Unix timestamp in seconds.
|
||||
fn now_unix_secs(&self) -> u64;
|
||||
|
||||
/// Returns the current Unix timestamp in milliseconds.
|
||||
fn now_unix_millis(&self) -> u128;
|
||||
}
|
||||
Reference in New Issue
Block a user