Crate af_core[][src]

A core library and async runtime for Rust applications.

Quick start

In Cargo.toml:

[dependencies]
af-core = "0.1"

In src/main.rs:

use af_core::prelude::*;

#[af_core::main]
async fn main() {
  info!("Hello world!");
}

Re-exports

pub use self::random::random;
pub use serde_json as json;

Modules

channel

A multi-producer, multi-consumer channel.

derive

Commonly used derive macros.

env

Provides access to environment variables and well-known paths.

error

Basic error handling.

fail

A general purpose error type.

fmt

String formatting utilities.

future

Common Future types and utilities.

iter

Common Iterator types and utilities.

lazy

Lazy values and one-time initialization of static data.

log

Formatted logging using the log crate.

math

Utilties for working with numerical values.

path

Functions for working with Unicode file system paths.

prelude

A “prelude” module containing common imports.

random

Random number generation.

stream

Common Stream types and utilities.

string

Common string types and utilities.

task

Task-based concurrency.

test

Concurrent test suites.

thread

Thread management.

time

Utilities for working with time.

util

Miscellaneous utilities.

Macros

fail

Returns an Err containing a new fail::Error from format args.

Functions

run

Starts a task from the given future, waits for it to stop, then exits the process.

run_with

Starts a task from the given function, waits for it to stop, then exits the process.

Attribute Macros

main

Defines an async main function for an af-core application.