Expand description
Task-affine, typed MUI objects for AROS.
This crate wraps MUI object creation, attributes, methods, notifications,
and custom classes with class- and value-typed Rust APIs. It builds on
aros-mui-sys for generated native identifiers and ABI declarations, and
keeps direct native vector access outside its public safe interface.
§Task and scope ownership
Open Mui on an AROS Context, then create objects in
Mui::scope. A scope owns every native object, string array, callback,
and custom-class registration created through it. Its higher-ranked
closure prevents scope-bound handles from escaping. These values are task
affine and cannot be sent to another task.
Scope::builder constructs a typed Object. Objects begin as native
roots; Object::adopt can transfer a child to a class-checked parent.
Both root objects and attached children remain usable through typed handles
until the scope ends. At scope teardown, the scope disposes remaining roots
and native parents dispose their adopted descendants.
§Typed interfaces and raw boundaries
The attributes module describes each generated attribute, the classes
on which it is valid, and whether it can be used during construction,
queried, or set. Object::set, Object::get, and typed methods accept
only descriptors with the corresponding capability. methods contains
generated message descriptors for calls whose message layout still needs
caller validation; dispatching those messages uses the explicit unsafe
Object::call_raw boundary. Raw attribute access follows the same rule.
ForeignPtr is another explicit unsafe boundary for pointers retained by
native code. Ordinary native vectors are not exposed by this crate.
Notifications are registered between objects in the same scope. Hooks are retained by that scope and are non-reentrant. Safe custom classes declare argument-free methods and forward other native messages to their superclass; messages with foreign layouts require the raw interface.
The generated classes and values modules contain the supported
standard class hierarchy and typed enum/value vocabulary.
Modules§
- attributes
- Complete typed and classified public MUI attribute surface.
- classes
- Complete public standard MUI class and inheritance surface.
- methods
- Complete classified public MUI method surface.
- value
- Built-in safe value representations used by generated attributes.
- values
- Typed enum groups and the complete raw public value surface.
Structs§
- Builder
- Typed construction-tag builder for one generated native class.
- Custom
Builder - Typed tag builder for an instance of a registered custom class.
- Custom
Class - Scope-owned registration of one native MUI custom class.
- Custom
Object - Live instance of one registered custom class.
- Foreign
Ptr - Explicit expert boundary for a foreign pointer retained by MUI.
- Hook
- A callback retained by one live
Scope. - Hook
Call - Value delivered by a typed MUI notification callback.
- Mui
- Open MUI and Intuition libraries bound to one AROS application task.
- Notification
- A typed source attribute and trigger ready to be connected to one action.
- Object
- Copyable typed handle to native storage owned by its
Scope. - Return
Id - Nonzero value returned by an Application event loop.
- Scope
- Native object arena owned by one
Mui::scopeinvocation. - String
Array - Scope-owned, NULL-terminated array of C string pointers.
Enums§
- Error
- Loop
Control - Decision returned by an
Applicationevent handler. - Loop
Exit - Reason
Object::runreturned from the native Application input loop. - Trigger
- Typed condition for one attribute notification.
Traits§
- Attribute
- A typed MUI attribute applicable to class
C. - Build
Attribute - Typed attribute accepted by
Builder::with. - Class
- A sealed marker for one native MUI class.
- Custom
Class Spec - Safe definition of a regular MUI custom class.
- GetAttribute
- Typed attribute readable through
Object::get. - IsA
- Compile-time MUI superclass relation.
- MuiEnum
- Closed or validated numeric value used by a generated MUI enum.
- Parent
Of - A sealed, type-checked native parent/child ownership relation.
- RawAttribute
- Generated descriptor for a public native attribute whose complete value contract has not necessarily been proven safe.
- RawBuild
Attribute - Attribute accepted during construction through the explicit unsafe API.
- RawGet
Attribute - Attribute readable through the explicit unsafe API.
- RawMethod
- Generated native message descriptor. Calling it is unsafe because the message fields may contain unvalidated pointers and retained resources.
- RawSet
Attribute - Attribute writable through the explicit unsafe API.
- SetAttribute
- Typed attribute writable through
Object::setand methods that update attributes. - Value
Kind - Value representation selected by a generated attribute.