RouterExt
RouterExt adds hypersig routes to an axum Router. It needs the axum feature, which is on by default.
RouterExt
| Item | Summary |
|---|---|
hypersig_runtime | Serves the browser runtime at RUNTIME_PATH. |
action | Serves action with a handler that returns one batch of patches. |
stream | Serves stream on GET with a handler that returns a stream of patches. |
PageResponse | What a page handler returns: a page, a page with a status, a redirect, or a 404. |
PageResponse::with_status | Answers with page and the status status, such as a styled 404 Not Found. |
Unserved | A page request that reached no page, handed to the else handler of routes!. |
Unserved::status | The status the page for this request is sent with: 404 or 400. |
Unserved::within | The parameters of route, where the request's path starts with that route's path. |
RequestKind | What sent a request: the browser loading a page, or the runtime calling an action. |
RequestKind::of | The kind of the request whose head is request. |
ActionResponse | What an action handler returns: patches for the page whose signals are S. |
Handler | A function that serves a page, an action, or a stream. |
RequestError | A request to an action or an upload that was refused before its handler ran. |
RequestError::status | The status of the response the error answers with. |
Uploads
An upload is an action that also receives the files picked in a file input. Both carry the page's type.
| Item | Summary |
|---|---|
upload | Serves upload with a handler that receives its arguments and files as an Uploaded. |
Upload | An endpoint that receives arguments A and the files picked in a FileInput. |
Upload::max_bytes | The same upload, accepting a body of at most bytes bytes. The default is 8 MiB. |
Upload::under | The same upload under base, which the page's calls put before the path. |
Upload::call_with | A call that sends the files picked in files and args. |
FileInput | A file input whose files an Upload sends. |
FileInput::input | The <input type="file"> element. |
FileInput::clear | A statement that empties the input, such as after its files were sent. |
Uploaded | What an upload's handler receives: the arguments and the files. |
UploadedFile | One file of an upload, read into memory: its name, media type, and bytes. |
upload_stream | Serves upload with a handler that reads the files in chunks from an UploadStream. |
UploadStream | What a streaming upload's handler receives: the arguments, then the files one at a time. |
StreamedFile | One file of a streaming upload, read in chunks. |