v-shield 0.2.0

Platform layer + sync primitives for Ry-Dit game engine
Documentation
  • Coverage
  • 57.14%
    48 out of 84 items documented4 out of 28 items with examples
  • Size
  • Source code size: 41.42 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 25.8 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 51s Average build duration of successful builds.
  • all releases: 51s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • lapumlbb18-blip/Ry-dit
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lapumlbb18-blip

🛡️ V-Shield - Platform Layer + Sync Primitives

Platform detection + synchronization primitives for the Ry-Dit game engine.

Version Tests Rust License


📦 Qué incluye

Módulo Descripción
platform Detección automática de OS (Linux, Windows, macOS, Android, iOS, WASM)
sync Primitivas de sincronización (Mutex, RwLock, Barrier, Condvar)
platform_sync Sincronización de renderizado (X11, OpenGL, Auto)
graphics Colores RyDit + init de ventana (feature graphics, usa raylib)

🚀 Quick Start

use v_shield::sync::{Mutex, RwLock};
use v_shield::platform::{current_platform, PlatformConfig};
use v_shield::platform_sync::PlatformSync;

// Platform detection
let p = current_platform();
println!("Running on: {} ({})", p.name(), p.arch());

// Config defaults por plataforma
let config = PlatformConfig::for_current();

// Sync primitives (thread-safe)
let data = Mutex::new(vec![1, 2, 3]);
let cache = RwLock::new(String::new());

// Platform sync para renderizado (al final de cada frame)
let mut sync = PlatformSync::new();
// sync.sync();

🔧 Features

Feature Descripción Dependencias extra Tamaño
native (default) std::sync para Linux/Windows/macOS Ninguna 0 KB
wasm Fallback para WASM (Barrier, Condvar) Ninguna 0 KB
graphics (default) Colores raylib + init_window() raylib ~50 KB
async-tokio Wrappers async (tokio::sync) tokio (solo sync) ~80 KB
rt-linux Linux real-time (pendiente) rtsc ~20 KB

Uso sin graphics (más liviano)

[dependencies]
v-shield = { version = "0.2", default-features = false, features = ["native"] }

Uso con async

[dependencies]
v-shield = { version = "0.2", features = ["native", "async-tokio"] }
use v_shield::sync::async_wrappers::{AsyncMutex, AsyncRwLock};

📱 Para Termux/Android

Funciona sin cambios en Termux. Dependencias de sistema necesarias:

pkg install clang libx11-dev libxcb-dev

🏗️ Arquitectura

v-shield/
├── src/
│   ├── lib.rs              # Public API + re-exports
│   ├── platform/
│   │   └── mod.rs          # Platform detection + PlatformConfig
│   ├── platform_sync.rs    # Render sync (X11/OpenGL)
│   └── sync/
│       ├── mod.rs          # Sync module + Barrier/Condvar fallbacks
│       ├── mutex.rs        # Mutex wrapper (std or tokio)
│       └── rwlock.rs       # RwLock wrapper (std or tokio)

📊 Tests

cargo test -p v-shield
# 22 unit tests + 4 doc tests = 26 passing ✅

🔄 Integración con otros crates

ry-gfx (graphics)

use ry_gfx::render_queue::{PlatformSync, RenderQueue, DrawCommand};
// PlatformSync viene de v-shield (re-export)

ry-stream (networking)

use v_shield::sync::Mutex;  // Thread-safe Mutex para clientes
use ry_stream::server::StreamServer;

🎯 Filosofía

Low-End First: Funciona en un Redmi Note 8 con Adreno 610.

  • Sin features pesados por defecto
  • tokio solo con feature sync (~80KB), NO runtime full
  • raylib es opcional (feature graphics)
  • Zero dependencias extra en modo native

📝 Changelog

v0.2.0 (actual)

  • ✅ Platform detection (Linux, Windows, macOS, Android, iOS, WASM)
  • ✅ Sync primitives (Mutex, RwLock, Barrier, Condvar)
  • ✅ Platform Sync migrado de ry-gfx (ahora centralizado)
  • ✅ Features configurables (native, wasm, graphics, async-tokio)
  • ✅ 26 tests pasando

v0.1.0

  • Colores raylib + ColorRyDit enum
  • init_window() wrapper