Expand description
§WaterUI FFI
This crate provides a set of traits and utilities for safely converting between
Rust types and FFI-compatible representations. It is designed to work in no_std
environments and provides a clean, type-safe interface for FFI operations.
The core functionality includes:
IntoFFItrait for converting Rust types to FFI-compatible representationsIntoRusttrait for safely converting FFI types back to Rust types- Support for opaque type handling across FFI boundaries
- Array and closure utilities for FFI interactions
This library aims to minimize the unsafe code needed when working with FFI while maintaining performance and flexibility.
Modules§
- action
- animation
- app
- array
- closure
- Function callback wrappers for C-API interoperability.
- color
- components
- event
- FFI bindings for event types.
- gesture
- FFI bindings for gesture types.
- id
- reactive
- theme
- Theme FFI
- views
- window
Macros§
- export
- ffi_
binding - ffi_
computed - Generates computed FFI support for read-only reactive types.
- ffi_
computed_ ctor - Generates the native-controlled computed constructor.
- ffi_
metadata - Generates FFI functions for Metadata
types. - ffi_
reactive - Generates both binding and computed FFI support.
- ffi_
safe - Declares types as FFI-safe by implementing
IntoFFIandIntoRusttraits. - ffi_
view - impl_
deref - opaque
Structs§
- WuiAny
View - WuiEdge
Set - FFI-safe representation of edge set for safe area.
- WuiEnv
- WuiFocused
- FFI-safe representation of focused state.
- WuiForeground
Color - FFI-safe representation of a foreground color.
- WuiIgnore
Safe Area - FFI-safe representation of IgnoreSafeArea.
- WuiMetadata
- WuiRetain
- FFI-safe representation of Retain metadata. The actual retained value is opaque - renderers just need to keep it alive.
- WuiSecure
Marker - C-compatible empty marker struct for Secure metadata.
This is needed because
()(unit type) is not representable in C. - WuiShadow
- FFI-safe representation of a shadow.
- WuiStr
- WuiType
Id - Type ID as a 128-bit value for O(1) comparison.
Enums§
- WuiBackground
- FFI-safe representation of a background.
Traits§
- IntoFFI
- Defines a trait for converting Rust types to FFI-compatible representations.
- Into
NullableFFI - Into
Rust - Defines a trait for converting FFI-compatible types back to native Rust types.
- Invalid
Value - Opaque
Type - Defines a marker trait for types that should be treated as opaque when crossing FFI boundaries.
Functions§
- waterui_
anyview_ id - Gets the id of the anyview type as a 128-bit value for O(1) comparison.
- waterui_
clone_ ⚠env - Clones an existing environment instance
- waterui_
drop_ ⚠anyview - Safety
- waterui_
drop_ ⚠env - Safety
- waterui_
drop_ ⚠retain - Drops the retained value.
- waterui_
empty_ anyview - waterui_
env_ new - Creates a new environment instance
- waterui_
force_ ⚠as_ metadata_ background - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ env - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ focused - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ foreground - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ gesture - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ ignore_ safe_ area - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ on_ event - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ retain - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ secure - Force-casts an AnyView to this metadata type
- waterui_
force_ ⚠as_ metadata_ shadow - Force-casts an AnyView to this metadata type
- waterui_
metadata_ background_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ env_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ focused_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ foreground_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ gesture_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ ignore_ safe_ area_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ on_ event_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ retain_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ secure_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
metadata_ shadow_ id - Returns the type ID as a 128-bit value for O(1) comparison. Uses TypeId in normal builds, type_name hash in hot reload builds.
- waterui_
view_ ⚠body - Gets the body of a view given the environment
- waterui_
view_ ⚠id - Gets the id of a view as a 128-bit value for O(1) comparison.
- waterui_
view_ ⚠stretch_ axis - Gets the stretch axis of a view.
Type Aliases§
- WuiMetadata
Background - Type alias for Metadata
FFI struct - WuiMetadata
Env - Type alias for Metadata
FFI struct Layout: { content: *mut WuiAnyView, value: *mut WuiEnv } - WuiMetadata
Focused - Type alias for Metadata
FFI struct - WuiMetadata
Foreground - Type alias for Metadata
FFI struct - WuiMetadata
Gesture - Type alias for Metadata
FFI struct - WuiMetadata
Ignore Safe Area - Type alias for Metadata
FFI struct - WuiMetadata
OnEvent - Type alias for Metadata
FFI struct - WuiMetadata
Retain - Type alias for Metadata
FFI struct - WuiMetadata
Secure - Type alias for Metadata
FFI struct Layout: { content: *mut WuiAnyView, value: WuiSecureMarker } - WuiMetadata
Shadow - Type alias for Metadata
FFI struct