Skip to main content

Module prelude

Module prelude 

Source
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 — BuildInfo and build_info!.

Macros§

build_info
The BuildInfo of the crate this is written in.

Structs§

Application
The application: a Container with a boot lifecycle, an environment, and a filesystem layout.
Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AuthManager
Resolves named guards — guard("api") picks one by name.
AuthenticatedUser
The user resolved for this request, stored in its extensions.
Bearer
The Authorization: Bearer … token.
BelongsTo
The inverse — the child pointing back at its parent.
BelongsToMany
Many to many, through a pivot table.
Broadcasting
Publishes broadcasts through the configured driver.
BuildInfo
The identity of a running binary.
CacheManager
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.
ConfigurationKey
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.
EntityRepository
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 structured details payload, and an optional underlying cause.
Form
The merged request input (query string plus body), deserialised with string coercion — so a urlencoded page=2 fills a u32 field.
Gate
A registry of authorization abilities.
GroupAttributes
Attributes shared by every route declared inside a group.
HasMany
One parent, many children.
HasOne
One parent, one child.
Html
A text/html body.
Http
The outbound HTTP client.
JobContext
What a job can reach while it runs.
Json
The JSON request body, deserialised.
LocalFilesystem
Files under one root directory.
Method
The Request Method (VERB)
MethodOverride
Rewrites a POST carrying _method into 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.
QueueManager
Dispatches jobs onto the configured queue.
RawBody
The raw request body.
RecordMetrics
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.
RelatedCounts
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.
SessionBag
A request’s session.
SessionManager
The application’s session store and settings.
Socket
One connected client.
StartSession
Loads the session before the handler and persists it afterwards.
StatusCode
An HTTP status code (status-code in RFC 9110 et al.).
StorageManager
The application’s storage, as one container-storable value.
Timeout
Answers 408 when the handler takes longer than limit.
Trace
Joins each request to its trace, and puts the trace on the log line.
TrustProxies
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.
ViewData
A view name plus the data to render it with.
WebSocketRoutes
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.
BroadcastChannelName
One channel a broadcast is published to.
CacheDriver
Where cached values live.
Content
A message’s body: either a rendered view or literal text.
ErrorKind
The class of failure, which is also the HTTP status it renders as.
FilesystemDriver
Which Filesystem a named disk uses.
LogFormat
The shape of a log line.
MailDriver
Which Transport to build.
ParamConstraint
A restriction on what a route parameter may contain — a closed set of named kinds rather than a regular expression.
QueueDriver
Which Queue to build.
Rule
One validation rule.
SessionDriver
Which SessionStore to build.

Traits§

Authenticatable
A model that can be authenticated.
Broadcastable
An event that should reach a browser.
CacheContract
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.
FormRequest
A typed, authorised, validated request payload.
FromRequest
Something a handler parameter can be built from.
IntoResponse
Anything a handler can return.
Job
Work to be done later.
Mailable
An email, described rather than assembled.
MiddlewareContract
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.
ResourceController
A controller serving a RESTful resource.
ServiceProvider
A bundle of related bindings and their boot-time wiring.
WebSocketHandler
One WebSocket endpoint.

Functions§

field
Sugar for building a RuleSet entry.

Type Aliases§

Req
A shared request, as handlers receive it.
Result
The framework result type.
RuleSet
A set of rules per field.

Attribute Macros§

async_trait

Derive Macros§

Entity