Crate ft_sdk

Source
Expand description

This crate can only be used when compiling to wasm, and wasm is run by www.fifthtry.com, or by fastn, the command line tool to use help developers build FifthTry Apps or when self-hosting FifthTry Apps.

Re-exports§

pub use auth::UserId;
pub use from_request::Config;
pub use from_request::Form;
pub use from_request::FromRequest;
pub use from_request::Host;
pub use from_request::Json;
pub use from_request::MainPackage;
pub use from_request::Path;
pub use from_request::Scheme;
pub use from_request::WasmPackage;
pub use from_request::WrappedFromRequest;
pub use session::SessionData;
pub use session::SessionID;

Modules§

auth
chr
data
email
env
Functions to interact with the environment.
form
from_request
http
Functions and types to work with HTTP requests and responses.
processor
schema
session
utils
Utility functions for the SDK

Macros§

anyhow
Construct an ad-hoc error from a string or existing non-anyhow error value.
bail
Return early with an error.
ensure
Return early with an error if a condition is not satisfied.
not_found
Create a page not found response.
println
Print some data to the server log.
server_error
Create a page not found response.
unauthorised
Create a page not found response.

Structs§

Email
add an email to the offline email queue, so that the email can be sent later. these emails get picked up by the email worker.
EmailAddress
EmailHandle
[ft_sdk::send_mail()] returns an EmailHandle, which can be used to cancel the email during the web request. this is useful in case you want to do a cleanup in case a transaction fails, etc.
EncryptedString
Error
The Error type, a wrapper around a dynamic error type.
PlainText
RenderedEmail
Rng
Sqlite
The SQLite backend
SqliteConnection
UserData

Enums§

CancelEmailError
ConnectionError
DecryptionError
DecryptionError is returned as error when ft_sdk::decrypt fails.
EmailContent
The content of the email to send. Most fastn apps should prefer EmailContent::FromMKind as that allows end users of the fastn app to configure the email easily. The EmailContent::Rendered variant is allowed if you want to generate emails though some other mechanism.
SendEmailError
SpecialError

Traits§

Context
Provides the context method for Result.

Functions§

default_connection
default_sqlite
Get a connection to the default sqlite database.
single_error
uuid
generate UUID with XorShift algorithm
uuid_without_dashes
Generate UUID without dashes, this is useful for URLs, as one can click Alt-Backspace and delete the whole UUID. In the of regular UUID, it will delete only one part of it, and one has to press backspace multiple times to delete the whole UUID, which is annoying.

Type Aliases§

Connection
FormError
FrontendData
Result

Attribute Macros§

data
form
processor
wrapped_processor