From f5a82152394fde4d8f740f664ab7737b82861618 Mon Sep 17 00:00:00 2001 From: cashmere Date: Tue, 28 Jul 2026 19:41:16 +0200 Subject: feat: GPUI desktop port foundation - scene crate: full project/scene/element model, serde round-trip proven against the web SerializedProject shape - transfer crate: .ocp zip container, cross-compat with web fflate archives proven in both directions - storage crate: filesystem project store replacing IndexedDB, .ocp import/export - media crate: ffmpeg-next 8 decoder (frames, audio, thumbnails, waveform summaries) - playback crate: wall-clock anchored, frame-rounded playback clock - gpu crate: native texture readback; compositor renders headless offscreen on Vulkan (spike test) - flake devshell: rust toolchain, GPUI native deps, ffmpeg dev, bindgen clang args; GPUI hello-world builds - port plan in notes/gpui-port.md --- rust/crates/effect-defs/src/registry.rs | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 rust/crates/effect-defs/src/registry.rs (limited to 'rust/crates/effect-defs/src/registry.rs') diff --git a/rust/crates/effect-defs/src/registry.rs b/rust/crates/effect-defs/src/registry.rs new file mode 100644 index 00000000..340f9b9b --- /dev/null +++ b/rust/crates/effect-defs/src/registry.rs @@ -0,0 +1,35 @@ +use std::collections::HashMap; + +use crate::{EffectDefsError, types::EffectDefinition}; + +#[derive(Default)] +pub struct EffectsRegistry { + definitions: HashMap, +} + +impl EffectsRegistry { + pub fn new() -> Self { + Self::default() + } + + pub fn register(&mut self, definition: EffectDefinition) { + self.definitions + .insert(definition.effect_type.to_string(), definition); + } + + pub fn has(&self, key: &str) -> bool { + self.definitions.contains_key(key) + } + + pub fn get(&self, key: &str) -> Result<&EffectDefinition, EffectDefsError> { + self.definitions + .get(key) + .ok_or_else(|| EffectDefsError::UnknownEffect { + effect_type: key.to_string(), + }) + } + + pub fn get_all(&self) -> Vec<&EffectDefinition> { + self.definitions.values().collect() + } +} -- cgit v1.3.1