Expand description
Port collection macros for AtomVM
Provides safe Rust wrappers around AtomVM’s port driver API
§Design Philosophy
All operations work with any AtomTableOps implementation through dependency injection. No global state, no hardcoded dependencies.
Structs§
- AtomVM
Port Driver - Port driver registration structure
- Generic
Port Data - Generic port data wrapper with standard functionality
Enums§
- Port
Error - Error handling for port operations
- Port
Result - Port result enum
Traits§
- Port
Data - Trait for port data types to implement cleanup and message handling
Functions§
- create_
error_ reply - Create a standard error reply using any atom table
- create_
ok_ reply - Create a standard success reply using any atom table
- create_
port_ with_ data - Create a port with automatic platform data setup
- create_
port_ with_ data_ and_ term - Create a port with data and user term
- handle_
standard_ message - Generic standard message handler template
- parse_
gen_ message - Helper functions for port message handling Parse a generic port message into its components
- parse_
port_ ⚠message - Parse a generic port message into components
- port_
send_ ⚠message_ from_ task - Send an async message to an Erlang process from any context (ISR-safe)
- port_
send_ ⚠reply - Send a reply to an Erlang process from port context
- send_
async_ message - Send an async message to an Erlang process (ISR-safe)
- send_
reply - Send a reply to an Erlang process
- term_
to_ pid - Utility functions for common port operations Extract PID as u32 from Term (for use in async messaging)
- with_
port_ data - Safely execute a function with port data
- with_
port_ data_ mut - Safely execute a function with mutable port data
Type Aliases§
- ERL_
NIF_ TERM - ErlNif
Env - Message
- Port message type
- Port
Create Fn - Port
Destroy Fn - Port
Handler Fn - Port
Init Fn - Port driver function type signatures
- Port
OpResult - Result type for port operations