日本語

RouterExt

RouterExt adds hypersig routes to an axum Router. It needs the axum feature, which is on by default.

RouterExt

ItemSummary
hypersig_runtimeServes the browser runtime at RUNTIME_PATH.
actionServes action with a handler that returns one batch of patches.
streamServes stream on GET with a handler that returns a stream of patches.
PageResponseWhat a page handler returns: a page, a page with a status, a redirect, or a 404.
PageResponse::with_statusAnswers with page and the status status, such as a styled 404 Not Found.
UnservedA page request that reached no page, handed to the else handler of routes!.
Unserved::statusThe status the page for this request is sent with: 404 or 400.
Unserved::withinThe parameters of route, where the request's path starts with that route's path.
RequestKindWhat sent a request: the browser loading a page, or the runtime calling an action.
RequestKind::ofThe kind of the request whose head is request.
ActionResponseWhat an action handler returns: patches for the page whose signals are S.
HandlerA function that serves a page, an action, or a stream.
RequestErrorA request to an action or an upload that was refused before its handler ran.
RequestError::statusThe 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.

ItemSummary
uploadServes upload with a handler that receives its arguments and files as an Uploaded.
UploadAn endpoint that receives arguments A and the files picked in a FileInput.
Upload::max_bytesThe same upload, accepting a body of at most bytes bytes. The default is 8 MiB.
Upload::underThe same upload under base, which the page's calls put before the path.
Upload::call_withA call that sends the files picked in files and args.
FileInputA file input whose files an Upload sends.
FileInput::inputThe <input type="file"> element.
FileInput::clearA statement that empties the input, such as after its files were sent.
UploadedWhat an upload's handler receives: the arguments and the files.
UploadedFileOne file of an upload, read into memory: its name, media type, and bytes.
upload_streamServes upload with a handler that reads the files in chunks from an UploadStream.
UploadStreamWhat a streaming upload's handler receives: the arguments, then the files one at a time.
StreamedFileOne file of a streaming upload, read in chunks.