Crate workflow_core
source ·Expand description
workflow_core is a part of the workflow-rs
framework, subset of which is designed to function uniformally across multiple
environments including native Rust, WASM-browser and Solana OS targets.
This is a general-purpose crate that provides platform-uniform (native and WASM) abstractions for:
- async channels
- task spawn and sleep functions
- random identifiers
- async-friendly and threadsafe event triggers
- time (Instant and Duration) structs
- dynamic async_trait attribute macros
Modules
async_std::channelre-exports and shims- Rust enum conversion utilities
- Access to environment variables when running natively or on top of Node.js (via
process.env). - 64-bit random identifier struct
Idthat renders its value as a base58 string LookupHandlerprovides ability to queue multiple async requests for the same key into a group of futures that resolve upon request completion.- re-export of
instantcrate supporting native and WASM implementations - trigger re-exports and shims
- buffer slicing and other utilities
Macros
- re-export of
cfg_ifcrate The main macro provided by this crate. See crate documentation for more information. - Associates u8 values to each enum value and declares a
TryFrom<u8>implementation for this enum allowing atry_from(u8)to enum conversion. - Associates u16 values to each enum value and declares a
TryFrom<u16>implementation for this enum allowing atry_from(u16)to enum conversion. - Associates u32 values to each enum value and declares a
TryFrom<u32>implementation for this enum allowing atry_from(u32)to enum conversion. - Associates usize values to each enum value and declares a
TryFrom<usize>implementation for this enum allowing atry_from(usize)to enum conversion.
Attribute Macros
- dynamically configured re-export of async_trait as workflow_async_trait that imposes
Sendrestriction in native (non-WASM) and removesSendrestriction in WASM builds.