Skip to main content

Module artifact_server

Module artifact_server 

Source
Expand description

Exposes the artifact_server module.

§Examples

ⓘ
use pharos_runtime_static::artifact_server;
  • crate for sibling modules in the same crate.

Structs§

StaticResponse
A bounded static response selected from one packaged app artifact.
StreamError
A bounded static error plus optional unsatisfied representation length.
StreamResponse
A validated file slice that can be copied to a connection with bounded memory.

Constants§

MAX_REQUEST_TARGET_BYTES 🔒
MAX_ROUTE_LINE_BYTES 🔒
MAX_STATIC_FILE_BYTES 🔒

Functions§

byte_range 🔒
Parses one RFC 7233 byte range against a known representation length.
cache_control_for_path 🔒
Selects immutable caching only for filenames that visibly carry a content hash.
content_type_for_path 🔒
Parses the content type for path.
file_etag 🔒
Creates a deterministic validator without reading the representation body.
handle_client 🔒
Handles client.
lookup_route_map
Looks up one GET route in the artifact route map.
normalized_path 🔒
Performs normalized path.
path_has_parent_reference
Returns whether a request path contains a parent-directory component.
percent_decode_path 🔒
Performs percent decode path.
read_file 🔒
Reads file.
request_head 🔒
Handles request head.
resolve_direct_asset
Resolves a direct /static/ or /media/ request under an artifact root.
response 🔒
Performs response.
response_bytes 🔒
Performs response bytes.
run
Runs the bounded loopback static-server binary for one packaged artifact.
safe_artifact_path 🔒
Builds a safe artifact path.
send_all 🔒
Sends all.
send_stream 🔒
Streams one selected response body to the standalone static server client.
serve_artifact_request
Serves one request from one app artifact root without invoking a shell or C runtime.
serve_private_asset
Resolves one already-authorized private asset key into a streaming plan.
serve_streamable_asset
Resolves a public static/media request into a bounded streaming plan.
stream_error 🔒
Wraps one ordinary static error without range metadata.
text_error 🔒
Performs text error.