Skip to main content

Module prelude

Module prelude 

Source
Expand description

use arcly_http::prelude::*; brings in everything a user needs.

Re-exports§

pub use crate::app::App;
pub use crate::app::LaunchConfig;
pub use crate::auth::cookie::CookieConfig;
pub use crate::auth::cookie::CookieService;
pub use crate::auth::cookie::SameSite;
pub use crate::auth::guards::JwtAuthGuard;
pub use crate::auth::guards::RoleGuard;
pub use crate::auth::guards::SessionAuthGuard;
pub use crate::auth::guards::JWT_AUTH;
pub use crate::auth::guards::SESSION_AUTH;
pub use crate::auth::oauth::OAuth2Provider;
pub use crate::auth::oauth::OAuth2Service;
pub use crate::auth::oauth::OAuth2UserInfo;
pub use crate::auth::policy::check_policies;
pub use crate::auth::policy::Decision;
pub use crate::auth::policy::EnvAttributes;
pub use crate::auth::policy::PolicyEngine;
pub use crate::auth::policy::PolicyInput;
pub use crate::auth::policy::PolicySet;
pub use crate::auth::policy::PolicySource;
pub use crate::auth::secrets::spawn_secret_watcher;
pub use crate::auth::secrets::Rotating;
pub use crate::auth::secrets::SecretSource;
pub use crate::auth::secrets::SecretVersion;
pub use crate::auth::session::Session;
pub use crate::auth::session::SessionConfig;
pub use crate::auth::session::SessionManager;
pub use crate::auth::session::SessionStore;
pub use crate::auth::JwtConfig;
pub use crate::auth::JwtService;
pub use crate::cache::stats as cache_stats;
pub use crate::cache::CacheInterceptor;
pub use crate::cache::CacheStats;
pub use crate::compliance::CryptoError;
pub use crate::compliance::CryptoVault;
pub use crate::compliance::DataKey;
pub use crate::compliance::EncryptRecord;
pub use crate::compliance::EncryptedField;
pub use crate::compliance::KekSource;
pub use crate::compliance::KeyId;
pub use crate::compliance::MaskRule;
pub use crate::compliance::MaskStrategy;
pub use crate::compliance::Masker;
pub use crate::compliance::MaskingPolicy;
pub use crate::core::engine::FrozenDiContainer;
pub use crate::core::plugins::ArclyPlugin;
pub use crate::core::plugins::ArclyPluginContext;
pub use crate::core::plugins::PluginError;
pub use crate::core::plugins::PluginStage;
pub use crate::data::db::ArclyDbPool;
pub use crate::data::db::DbDriver;
pub use crate::data::db::DbHealthCheck;
pub use crate::data::db::OwnedDbConn;
pub use crate::data::migrate::Migration;
pub use crate::data::migrate::MigrationReport;
pub use crate::data::migrate::MigrationRunner;
pub use crate::data::outbox::with_transaction;
pub use crate::data::outbox::OutboxEntry;
pub use crate::data::outbox::OutboxPublisher;
pub use crate::data::outbox::OutboxRelay;
pub use crate::data::outbox::OutboxStore;
pub use crate::data::outbox::OutboxTx;
pub use crate::data::outbox::TransactionalDataSource;
pub use crate::data::tx::in_transaction;
pub use crate::data::tx::with_current_tx;
pub use crate::data::tx::ArclyTransaction;
pub use crate::data::AccessIntent;
pub use crate::data::DataError;
pub use crate::data::DataErrorKind;
pub use crate::data::DataSource;
pub use crate::data::DataSourceRegistry;
pub use crate::data::ReadAfterWritePin;
pub use crate::http::IntoResponse;
pub use crate::http::Json;
pub use crate::interceptors::EnvelopeResponse;
pub use crate::interceptors::Interceptor;
pub use crate::interceptors::LatencyLog;
pub use crate::interceptors::NextHandler;
pub use crate::interceptors::TelemetryLog;
pub use crate::interceptors::TraceInterceptor;
pub use crate::messaging::ConsumerRuntime;
pub use crate::messaging::EventContext;
pub use crate::messaging::EventHandlerDescriptor;
pub use crate::messaging::InboundMessage;
pub use crate::messaging::MessageTransport;
pub use crate::observability::audit::AuditOutcome;
pub use crate::observability::audit::AuditPipeline;
pub use crate::observability::audit::AuditRecord;
pub use crate::observability::audit::AuditSink;
pub use crate::observability::health::HealthCheck;
pub use crate::observability::health::HealthRegistry;
pub use crate::observability::health::HealthStatus;
pub use crate::observability::plugin::ArclyObservabilityPlugin;
pub use crate::openapi::ApiKeyIn;
pub use crate::openapi::OpenApiInfo;
pub use crate::openapi::SecurityScheme;
pub use crate::pipeline::Provenance;
pub use crate::resilience::Bulkhead;
pub use crate::resilience::DLockBackend;
pub use crate::resilience::DistributedLock;
pub use crate::resilience::DistributedRateLimit;
pub use crate::resilience::FailurePolicy;
pub use crate::resilience::LockGuard;
pub use crate::resilience::RateDecision;
pub use crate::resilience::RateLimit;
pub use crate::resilience::RateLimitBackend;
pub use crate::security::configure as configure_security;
pub use crate::security::FrameOptions;
pub use crate::security::SecurityConfig;
pub use crate::validation::Validated;
pub use crate::web::boundary::BoundaryFilter;
pub use crate::web::cors::CorsConfig;
pub use crate::web::dynamic::DynamicRouteTable;
pub use crate::web::dynamic::DYNAMIC_PREFIX;
pub use crate::web::error::BadRequest;
pub use crate::web::error::Conflict;
pub use crate::web::error::FieldError;
pub use crate::web::error::Forbidden;
pub use crate::web::error::GatewayTimeout;
pub use crate::web::error::HttpError;
pub use crate::web::error::HttpException;
pub use crate::web::error::Internal;
pub use crate::web::error::NotFound;
pub use crate::web::error::ProblemDetails;
pub use crate::web::error::ServiceUnavailable;
pub use crate::web::error::TooManyRequests;
pub use crate::web::error::Unauthorized;
pub use crate::web::error::Validation;
pub use crate::web::idempotency::IdempotencyDecision;
pub use crate::web::idempotency::IdempotencyStore;
pub use crate::web::responses::Accepted;
pub use crate::web::responses::Created;
pub use crate::web::responses::NoContent;
pub use crate::web::tenant::TenantConfig;
pub use crate::web::tenant::TenantGuard;
pub use crate::web::tenant::TenantId;
pub use crate::web::tenant::TenantRegistry;
pub use crate::web::tenant::TenantStrategy;
pub use crate::web::tenant::TENANT;
pub use crate::web::Error;
pub use crate::web::Inject;
pub use crate::web::RequestContext;

Traits§

JsonSchema
A type which can be described as a JSON Schema document.
Validate
This is the original trait that was implemented by deriving Validate. It will still be implemented for struct validations that don’t take custom arguments. The call is being forwarded to the ValidateArgs<'v_a> trait.

Type Aliases§

Response
The framework’s response type. Same memory shape as axum’s; the alias keeps the user-visible path arcly_http::Response. Type alias for http::Response whose body type defaults to Body, the most common body type used with axum.

Attribute Macros§

AuditLog
#[AuditLog(action = "…", resource = "…")] — emit one compliance audit record per invocation, keyed on the response status. Consumed by #[Controller]; pass-through marker on free fns.
CacheKey
#[CacheKey("template")] — custom key. Marker attribute; see CacheTTL.
CacheTTL
#[CacheTTL(N)] — TTL in seconds. Marker attribute consumed by the route macro and stuffed into RouteSpec.cache_ttl_secs. Pass-through here so the type system accepts it standalone.
Controller
#[Controller("/prefix", tags(..))] — declare an HTTP controller.
Delete
#[Delete("/path")] — map a method (or free function) to an HTTP DELETE route.
Deprecated
#[Deprecated(sunset = "YYYY-MM-DD")] on a #[Controller] impl — adds RFC 8594 Deprecation/Sunset headers to every response from this controller. Marker; consumed by #[Controller].
EncryptFields
#[EncryptFields(key = "tenant:acme", fields("ssn", "items.*.diagnosis"))] on a Serialize + Deserialize struct implements EncryptRecord: record.seal(&vault) returns a serde_json::Value with the declared fields sealed (safe for any durable sink); T::unseal(value, &vault) reverses it. Use seal_with_key/KeyId::subject(...) for per-subject keys minted at runtime (crypto-shredding granularity).
EventConsumer
#[EventConsumer] on an impl block — registers every #[EventPattern] method into the link-time event registry (the messaging analogue of #[Controller]). Methods take EventContext and return Result<(), String>.
EventPattern
#[EventPattern("topic")] — marks a method inside an #[EventConsumer] impl as the handler for one topic. Marker; consumed by #[EventConsumer].
Get
#[Get("/path")] — map a method (or free function) to an HTTP GET route.
Idempotent
#[Idempotent(ttl = "24h")] — Stripe-style Idempotency-Key handling: claim → run → store; retries replay the stored response; concurrent duplicates get 409. Consumed by #[Controller].
Injectable
#[Injectable] — turn a struct into a zero-lock DI provider.
MaskFields
#[MaskFields("email", "card:last4")] — redact these JSON response fields (plus the global Masker rules) before any durable layer sees the body. Consumed by #[Controller].
Module
#[Module(controllers(..), providers(..), imports(..))] — declare a unit of the application DAG.
Patch
#[Patch("/path")] — map a method (or free function) to an HTTP PATCH route.
Post
#[Post("/path")] — map a method (or free function) to an HTTP POST route.
Put
#[Put("/path")] — map a method (or free function) to an HTTP PUT route.
RequirePolicies
#[RequirePolicies("orders.refund", …)] — ABAC route gate: every listed action must Permit under the hot-reloadable PolicyEngine (default-deny). Consumed by #[Controller].
Timeout
#[Timeout("2s")] — route deadline; 504 + future cancellation on expiry. Consumed by #[Controller]; pass-through marker on free fns.
Transactional
#[Transactional] — wrap the handler in a database transaction on the request-tenant’s pool: commit on Ok, rollback on Err/cancellation. Consumed by #[Controller]; pass-through marker on free fns.
UseInterceptors
#[UseInterceptors(A, B)] on a free fn — wraps that handler’s thunk.
Version
#[Version("v1")] on a #[Controller] impl — mounts every route under /v1/... and records the version in each RouteSpec. Marker; consumed by #[Controller].
circuit_breaker
#[circuit_breaker(..)] — wrap a method in a circuit breaker.

Derive Macros§

JsonSchema
Validate