Expand description
Everything an application file usually wants in scope.
use rainier_framework::prelude::*;Re-exports§
pub use crate::bootstrap::Rainier;pub use crate::facades::Broadcast;pub use crate::facades::Cache;pub use crate::facades::Config;pub use crate::facades::Crypt;pub use crate::facades::Event;pub use crate::facades::Mail;pub use crate::facades::Middleware;pub use crate::facades::Notify;pub use crate::facades::Queue;pub use crate::facades::Session;pub use crate::facades::Storage;pub use crate::facades::Url;pub use crate::facades::View;pub use crate::facades::Views;pub use crate::facades::DB;pub use rainier_support::Context as _;pub use rainier_config::Setting as _;pub use crate::binding::Bound;pub use crate::binding::BoundAs;pub use rainier_cache::CacheExt as _;pub use rainier_crypt::EncrypterExt as _;pub use rainier_crypt::SignerExt as _;pub use rainier_filesystem::FilesystemExt as _;pub use rainier_session::SessionRequestExt as _;pub use rainier_auth::GuardExt as _;
Modules§
- build_
info - What is actually running —
BuildInfoandbuild_info!.
Macros§
- build_
info - The
BuildInfoof the crate this is written in.
Structs§
- Application
- The application: a
Containerwith a boot lifecycle, an environment, and a filesystem layout. - Arc
- A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
- Auth
Manager - Resolves named guards —
guard("api")picks one by name. - Authenticated
User - The user resolved for this request, stored in its extensions.
- Bearer
- The
Authorization: Bearer …token. - Belongs
To - The inverse — the child pointing back at its parent.
- Belongs
ToMany - Many to many, through a pivot table.
- Broadcasting
- Publishes broadcasts through the configured driver.
- Build
Info - The identity of a running binary.
- Cache
Manager - The application’s cache, as one container-storable value.
- Channels
- The channels one notification goes out on.
- Compress
- Gzips or deflates a response when the client asked for it and the body is worth it.
- Configuration
Key - A dotted path, and the type stored at it.
- Container
- A registry of services keyed by their Rust type.
- Cookie
- A cookie to send, or one that arrived.
- Credentials
- The values a user submitted to log in.
- Criteria
- A recorded, replayable set of query constraints.
- Database
- A database handle: a shared
Connection, cheap to clone. - Dispatcher
- Registers listeners and dispatches events to them.
- Encryption
- The application’s encrypter and signer, as one container-storable value.
- Entity
Repository - The generic repository: one implementation serving every
Model. - Envelope
- Who a message is from, to, and about.
- Error
- A framework error: a
kind, a human message, an optional structureddetailspayload, and an optional underlying cause. - Form
- The merged request input (query string plus body), deserialised with string
coercion — so a urlencoded
page=2fills au32field. - Gate
- A registry of authorization abilities.
- Group
Attributes - Attributes shared by every route declared inside a
group. - HasMany
- One parent, many children.
- HasOne
- One parent, one child.
- Html
- A
text/htmlbody. - Http
- The outbound HTTP client.
- JobContext
- What a job can reach while it runs.
- Json
- The JSON request body, deserialised.
- Local
Filesystem - Files under one root directory.
- Method
- The Request Method (VERB)
- Method
Override - Rewrites a
POSTcarrying_methodinto that method. - Metrics
- Everything this process has recorded.
- Next
- The remainder of the pipeline, handed to each middleware.
- Notifier
- Holds the configured channels and fans a notification out across them.
- Paginated
- One page of results, plus enough metadata to render a pager.
- Path
- The route parameters, deserialised with string coercion.
- Query
- The query string, deserialised with string coercion.
- Queue
Manager - Dispatches jobs onto the configured queue.
- RawBody
- The raw request body.
- Record
Metrics - Times every request and counts it by method, route and status.
- Redirect
- A redirect response.
- Related
- Rows loaded for a relationship, grouped by the near side’s key.
- Related
Counts - Counts loaded for a relationship, without loading the rows.
- Request
- An inbound HTTP request.
- Response
- An outgoing HTTP response.
- Rooms
- Every socket currently connected, grouped by a key you choose.
- Route
- A declared route.
- Router
- The route table under declaration.
- Session
Bag - A request’s session.
- Session
Manager - The application’s session store and settings.
- Socket
- One connected client.
- Start
Session - Loads the session before the handler and persists it afterwards.
- Status
Code - An HTTP status code (
status-codein RFC 9110 et al.). - Storage
Manager - The application’s storage, as one container-storable value.
- Timeout
- Answers
408when the handler takes longer thanlimit. - Trace
- Joins each request to its trace, and puts the trace on the log line.
- Trust
Proxies - Rewrites the client address from
X-Forwarded-For, when the peer is a proxy you trust. - Validated
- The extractor that runs a
FormRequest. - Validator
- Checks input against a rule set.
- View
Data - A view name plus the data to render it with.
- WebSocket
Routes - The WebSocket routes an application declares —
routes/ws.rs.
Enums§
- AppEnv
APP_ENV: which deployment the process is running as.- Backoff
- How long to wait between attempts.
- Broadcast
Channel Name - One channel a broadcast is published to.
- Cache
Driver - Where cached values live.
- Content
- A message’s body: either a rendered view or literal text.
- Error
Kind - The class of failure, which is also the HTTP status it renders as.
- Filesystem
Driver - Which
Filesystema named disk uses. - LogFormat
- The shape of a log line.
- Mail
Driver - Which
Transportto build. - Param
Constraint - A restriction on what a route parameter may contain — a closed set of named kinds rather than a regular expression.
- Queue
Driver - Which
Queueto build. - Rule
- One validation rule.
- Session
Driver - Which
SessionStoreto build.
Traits§
- Authenticatable
- A model that can be authenticated.
- Broadcastable
- An event that should reach a browser.
- Cache
Contract - A key/value store with expiry.
- Entity
- A struct that maps to one table. Implemented by
#[derive(Entity)]; hand impls are possible but the derive is the intended path. - Facade
- A static proxy onto a container-resolved service.
- Filesystem
- Where a driver keeps bytes.
- Form
Request - A typed, authorised, validated request payload.
- From
Request - Something a handler parameter can be built from.
- Into
Response - Anything a handler can return.
- Job
- Work to be done later.
- Mailable
- An email, described rather than assembled.
- Middleware
Contract - A stage in the request pipeline.
- Model
- An entity the framework manages.
- Notifiable
- Something that can be sent a notification.
- Notification
- A message to a
Notifiable, rendered differently per channel. - Relation
- What every relationship can do.
- Repository
- Read and write access to one model’s rows.
- Resource
Controller - A controller serving a RESTful resource.
- Service
Provider - A bundle of related bindings and their boot-time wiring.
- WebSocket
Handler - One WebSocket endpoint.
Functions§
Type Aliases§
- Req
- A shared request, as handlers receive it.
- Result
- The framework result type.
- RuleSet
- A set of rules per field.