Crate waterui_ffi

Crate waterui_ffi 

Source
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:

  • IntoFFI trait for converting Rust types to FFI-compatible representations
  • IntoRust trait 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 IntoFFI and IntoRust traits.
ffi_view
impl_deref
opaque

Structs§

WuiAnyView
WuiEdgeSet
FFI-safe representation of edge set for safe area.
WuiEnv
WuiFocused
FFI-safe representation of focused state.
WuiForegroundColor
FFI-safe representation of a foreground color.
WuiIgnoreSafeArea
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.
WuiSecureMarker
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
WuiTypeId
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.
IntoNullableFFI
IntoRust
Defines a trait for converting FFI-compatible types back to native Rust types.
InvalidValue
OpaqueType
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§

WuiMetadataBackground
Type alias for Metadata FFI struct
WuiMetadataEnv
Type alias for Metadata FFI struct Layout: { content: *mut WuiAnyView, value: *mut WuiEnv }
WuiMetadataFocused
Type alias for Metadata FFI struct
WuiMetadataForeground
Type alias for Metadata FFI struct
WuiMetadataGesture
Type alias for Metadata FFI struct
WuiMetadataIgnoreSafeArea
Type alias for Metadata FFI struct
WuiMetadataOnEvent
Type alias for Metadata FFI struct
WuiMetadataRetain
Type alias for Metadata FFI struct
WuiMetadataSecure
Type alias for Metadata FFI struct Layout: { content: *mut WuiAnyView, value: WuiSecureMarker }
WuiMetadataShadow
Type alias for Metadata FFI struct