pub enum EventPayload {
Empty,
Inline(BTreeMap<String, Value>),
FatBuffer(AssetRef),
}Expand description
The payload of an inbound event — either inline data or a fat buffer reference.
Variants§
Empty
Empty payload (e.g. a key release with no additional data).
Inline(BTreeMap<String, Value>)
Inline scalar values (pointer x/y, key code, touch point).
FatBuffer(AssetRef)
Fat buffer reference (depth map, EEG raw, skeleton data). The host holds the actual data; VibeScript sees the AssetRef.
Implementations§
Source§impl EventPayload
impl EventPayload
Sourcepub fn inline_kv(key: &str, val: Value) -> Self
pub fn inline_kv(key: &str, val: Value) -> Self
Create an inline payload with a single key-value pair.
Sourcepub fn inline_pairs(pairs: &[(&str, Value)]) -> Self
pub fn inline_pairs(pairs: &[(&str, Value)]) -> Self
Create an inline payload from a slice of key-value pairs.
Sourcepub fn fat_buffer(iri: &str, hash: u64) -> Self
pub fn fat_buffer(iri: &str, hash: u64) -> Self
Create a fat buffer payload.
Sourcepub fn is_fat_buffer(&self) -> bool
pub fn is_fat_buffer(&self) -> bool
Is this payload a fat buffer?
Trait Implementations§
Source§impl Clone for EventPayload
impl Clone for EventPayload
Auto Trait Implementations§
impl Freeze for EventPayload
impl RefUnwindSafe for EventPayload
impl Send for EventPayload
impl Sync for EventPayload
impl Unpin for EventPayload
impl UnsafeUnpin for EventPayload
impl UnwindSafe for EventPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more