Skip to main content

Crate tuwunel_core

Crate tuwunel_core 

Source
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 on Ready(None) or Pending.
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§

RoomVersion
A Matrix room version ID.

Statics§

RUSTC_FLAGS
Stores the compiler arguments captured while building this crate.

Functions§

_set_rustc_flags 🔒
_unset_rustc_flags 🔒

Attribute Macros§

async_noinline
implement