Crate workflow_core

Source
Expand description

github crates.io docs.rs license

workflow_core is a part of the workflow-rs framework, subset of which is designed to function uniformly 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, sleep and interval functions
  • random identifiers
  • async-friendly and thread-safe event triggers
  • time (Instant and Duration) as well as functions to obtain UNIX time (native and WASM)
  • yield_executor() function to yield Rust executor to browser using requestAnimationFrame() (this prevents async Rust applications from locking down the Browser UX)
  • runtime auto detection, allowing to identify the operating environment at runtime
  • home and data folder access (useful when combined with workflow_store crate)

Modules§

abortable
Abortable trigger, can be used to cancel (abort) an asynchronous task.
channel
async_std::channel re-exports and shims
dirs
Access to home and data folder (windows) when running natively or within Node.js
enums
Rust enum conversion utilities
env
Access to environment variables when running natively or on top of Node.js (via process.env).
extensions
Miscellaneour helper traits.
fd
Module for the file descriptor limit management.
hex
Hex serialization traits
id
64-bit random identifier struct Id that renders its value as a base58 string
lookup
LookupHandler provides ability to queue multiple async requests for the same key into a group of futures that resolve upon request completion.
prelude
The prelude module re-exports the most commonly used traits and types from the workflow_core crate.
runtime
Provides functions that allow to detect the runtime environment. These functions can be used to detect whether the code is running in a browser, node.js or native OS, the type of the underlying OS (Windows,Linux,MacOS,*BSD) as well as the type of a web environment (Browser or NWJS). This is useful for an application of an API to detect which environment it is operating under and subsequently restrict the functionality to the capabilities to this environment.
sendable
Sendable NewType for automatic Send marker wrapping of JS primitives.
task
task module provides helper functions for use with async closures that operate uniformly in native (tokio-backed) and WASM (async_std-backed) environments (i.e. a web browser).
time
time module provides re-export of WASM32-compatible Instant and provides platform neutral implementations for unixtime_as_millis_u128() and unixtime_as_millis_f64().
trigger
Trigger crate re-exports and shims
utils
buffer slicing and other utilities
version

Macros§

cfg_if
Re-export of cfg_if crate. The main macro provided by this crate. See crate documentation for more information.
seal
Seal macro that prevents accidental modification of the enclosed source code by hashing the source code and comparing it to the supplied hash. If the code is modified, the macro will fail to compile, and the developer will need to change the hash value. This is useful for locking down sensitive parts of the code to prevent their accidental change.
u8_try_from
Associates u8 values to each enum value and declares a TryFrom<u8> implementation for this enum allowing a try_from(u8) to enum conversion.
u16_try_from
Associates u16 values to each enum value and declares a TryFrom<u16> implementation for this enum allowing a try_from(u16) to enum conversion.
u32_try_from
Associates u32 values to each enum value and declares a TryFrom<u32> implementation for this enum allowing a try_from(u32) to enum conversion.
usize_try_from
Associates usize values to each enum value and declares a TryFrom<usize> implementation for this enum allowing a try_from(usize) to enum conversion.
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy