Skip to main content

Module prelude

Module prelude 

Source
Expand description

Re-exports commonly used types for convenient use across the crate. Intended to be glob-imported like use crate::prelude::*;.

Re-exports§

pub use crate::controllers::UploadResult;
pub use crate::controllers::helpers::file_uploading::StoreKind;
pub use crate::controllers::helpers::file_uploading::upload_field_from_cms;
pub use crate::controllers::helpers::file_uploading::upload_file_from_cms;
pub use crate::domain::authorization::Action as Act;
pub use crate::domain::authorization::AuthUser;
pub use crate::domain::authorization::Resource as Res;
pub use crate::domain::authorization::authorize;
pub use crate::domain::authorization::authorize_access_to_course_material;
pub use crate::domain::authorization::parse_secret_key_from_header;
pub use crate::domain::authorization::skip_authorize;
pub use crate::domain;
pub use crate::domain::error::ControllerError;
pub use crate::domain::error::ControllerErrorType;
pub use crate::domain::error::ControllerResult;
pub use crate::domain::request_id::RequestId;
pub use headless_lms_models as models;

Modules§

anyhow
githubcrates-iodocs-rs
chrono
Chrono: Date and Time for Rust
futures
Abstractions for asynchronous programming.
serde_json
Serde JSON
tokio
A runtime for writing reliable network applications without compromising speed.
web
Essentials helper functions and types for application registration.

Macros§

debug
Constructs an event at the debug level.
error
Constructs an event at the error level.
generated_docs
Includes the type’s generated docs as a string. generated by doc-file-generator as a string. Used with the helper macro from the doc-macro crate: #generated_doc
info
Constructs an event at the info level.
trace
Constructs an event at the trace level.
warn
Constructs an event at the warn level.

Structs§

ApplicationConfiguration
AzureBlobStorageConfiguration
AzureChatbotConfiguration
AzureConfiguration
AzureSearchConfiguration
Cache
Wrapper for accessing a redis cache. Operations are non-blocking and fail gracefully when Redis is unavailable.
DateTime
ISO 8601 combined date and time with time zone.
HttpRequest
An incoming request.
HttpResponse
An outgoing response.
ModelError
Error type used by all models. Used as the error type in ModelError, which is used by all the controllers in the application.
Multipart
The server-side implementation of multipart/form-data requests.
OAuthServerConfiguration
Pagination
Represents the URL query parameters page and limit, used for paginating database queries.
PgConnection
A connection to a PostgreSQL database.
Pool
An asynchronous pool of SQLx database connections.
Postgres
PostgreSQL database driver.
ServiceConfig
Enables parts of app configuration to be declared separately from the app itself. Helpful for modularizing large applications.
Url
A parsed URL record.
Utc
The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
UtilError
Error type used by all models. Used as the error type in UtilError, which is used by all the controllers in the application.
Uuid
A Universally Unique Identifier (UUID).

Enums§

CourseOrExamId
Either a course or exam id.
HttpErrorType
Types of HTTP errors that can occur
ModelErrorType
The type of ModelError that occured.
PKeyPolicy
Helper struct to use with functions that insert data into the database.
UtilErrorType
The type of UtilError that occured.

Traits§

BackendError
The error types of this program all implement this trait for interoperability.
Connection
Represents a single database connection.
Context
Provides the context method for Result.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
FileStore
Allows storing files to a file storage backend.
FromRow
A record that can be built from a row returned by the database.
Rng
Trait for infallible random number generators
RngExt
User-level interface for RNGs
Serialize
A data structure that can be serialized into any data format supported by Serde.
TryToOptional
Type
Indicates that a SQL type is supported for a database.

Type Aliases§

ModelResult
Used as the result types for all models.
PgPool
An alias for Pool, specialized for Postgres.
UtilResult
Used as the result types for all utils.

Derive Macros§

Deserialize
FromRow
Serialize
Type