Expand description
Provides shared runtime foundations for Tuwunel.
The crate centralizes configuration, errors, Matrix data types, logging, metrics, server lifecycle state, and reusable utilities. Higher-level workspace crates consume these APIs through a shared foundational dependency.
Re-exports§
pub use config::Config;pub use error::Error;pub use info::version;pub use info::version::version;pub use matrix::Event;pub use matrix::EventTypeExt;pub use matrix::Pdu;pub use matrix::PduCount;pub use matrix::PduEvent;pub use matrix::PduId;pub use matrix::pdu;pub use server::Server;pub use utils::result;pub use utils::result::Result;pub use crate as tuwunel_core;pub use ::arrayvec;pub use ::either;pub use ::http;pub use ::itertools;pub use ::jsonwebtoken as jwt;pub use ::ruma;pub use ::smallstr;pub use ::smallvec;pub use ::tokio_metrics;pub use ::toml;pub use ::tracing;
Modules§
- alloc
- Integration with allocators
- config
- Loads and validates server configuration.
- debug
- Provides diagnostics, debugger traps, and configurable debug logging.
- error
- Defines shared error and result types.
- info
- Information about the project. This module contains version, build, system, etc information which can be queried by admins or used by developers.
- log
- Configures structured logging and in-memory capture.
- matrix
- Core Matrix event and room-version types.
- metrics
- Collects task, runtime, and request metrics.
- mods
- Provides inert dynamic-module hooks when module loading is unavailable.
- server
- Tracks server lifecycle state and its runtime handle.
- utils
- Reusable helpers and extension traits for core services.
Macros§
- Err
- Constructs an error result through
err!. - apply
- Creates a closure that applies one callable to every field of a tuple.
- at
- Creates a closure that selects an indexed tuple field by value.
- checked
- Evaluates a checked arithmetic expression as a
Result. - debug
- Emits a debug-level tracing event.
- debug_
error - Emits an error event through debug-aware level control.
- debug_
event - Emits a tracing event with debug-aware level control.
- debug_
info - Emits an informational event through debug-aware level control.
- debug_
warn - Emits a warning event through debug-aware level control.
- defer
- Runs an action when the surrounding scope exits.
- deref_
at - Creates a closure that dereferences an indexed tuple field.
- err
- Constructs a core error from structured or formatted input.
- err_lev
- Resolves an error macro level to a tracing level.
- err_log
- Renders an error message and sends its fields to tracing and the log bridge.
- error
- Emits an error-level tracing event.
- event
- Emits a tracing event at a caller-supplied level.
- expected
- Evaluates a checked arithmetic expression and panics on failure.
- extract
- Extracts a pattern-bound value into an
Option. - extract_
variant - Extracts the payload from any listed tuple variant into an
Option. - format_
array_ string - Formats arguments into an array string with constant byte capacity.
- format_
maybe - Formats a literal only when placeholders appear to be present.
- format_
small_ string - Formats arguments into a small string with an inline byte capacity.
- info
- Emits an informational tracing event.
- is_
equal - Creates a two-argument closure that compares its inputs for equality.
- is_
equal_ to - Creates a closure that compares each input with a supplied value for equality.
- is_
false - Creates a closure that negates a Boolean input.
- is_
format - Tests whether a string literal appears to contain a formatting placeholder.
- is_
less_ than - Creates a closure that reports whether each input is less than a supplied value.
- is_
matching - Creates a closure that tests its input with a
matches!pattern. - is_
nonzero - Creates a closure that reports whether its input differs from zero.
- is_
not_ empty - Creates a closure that reports whether its input is nonempty.
- is_
not_ equal_ to - Creates a closure that compares each input with a supplied value for inequality.
- is_true
- Creates a Boolean identity closure.
- is_zero
- Creates a closure that reports whether its input matches zero.
- maybe_
unhandled - Panics with the supplied message for a branch that is not implemented.
- mod_
ctor - Defines an empty module-constructor hook.
- mod_
dtor - Defines an empty module-destructor hook.
- pair_of
- Expands a type or expression into a two-element tuple with identical entries.
- ready_
some - Unwrap the value from a
Poll<Option<T>>, early-returning from the enclosing function onReady(None)orPending. - redacted_
debug - Produces a debug label for an optional value without revealing its contents.
- ref_at
- Creates a closure that borrows an indexed tuple field.
- rustc_
flags_ capture - scope_
restore - Temporarily replaces a value and restores the previous value at scope exit.
- trace
- Emits a trace-level tracing event.
- unhandled
- Marks an unsupported branch and panics with the supplied message.
- val_at
- Creates a closure that returns an indexed field from a referenced tuple by value.
- validated
- Evaluates arithmetic with checks enabled only in debug builds.
- warn
- Emits a warning-level tracing event.
Enums§
- Room
Version - A Matrix room version ID.
Statics§
- RUSTC_
FLAGS - Stores the compiler arguments captured while building this crate.