Skip to main content

Crate hotaru

Crate hotaru 

Source
Expand description

Hotaru — the umbrella crate. Re-exports the public surface of hotaru_core, hotaru_http, hotaru_trans and friends behind a single import root. Most users want prelude; HTTP users also want http.

Re-exports§

pub use akari;
pub use hotaru_core;
pub use hotaru_http;
pub use hotaru_trans as hrt;
pub use ahttpm;
pub use hotaru_lib;

Modules§

http
HTTP-specific re-exports — request/response types, the HTTP protocol alias, and (with the https feature) the TLS variants. HTTP-specific re-exports for standard Hotaru HTTP implementation
prelude
Curated re-exports for typical user code: Server, Client, endpoint! / outpoint! macros, the Lazy-wrapped S* aliases, and the core protocol traits. Curated prelude — use hotaru::prelude::*; brings in Server, Client, the endpoint! / outpoint! / middleware! macros, the lazy-static S* aliases, and the core protocol traits.

Macros§

LClient
LClient! - Creates a lazy static Client instance.
LPattern
LPattern! - Creates a lazy static PathPattern instance
LServer
LServer! - Creates a lazy static Server instance.
LUrl
LUrl! - Creates a lazy static Url instance
call
Spawn a persistent outpoint call. Two forms:
endpoint
middleware
object
A macro to create an Value from a literal or expression. It can handle dictionaries, lists, booleans, strings, and numeric values.
outpoint
run
One-shot outpoint request:
run_server
run_server!(APP) — blocking entry, for sync fn main().
run_server_no_block
run_server_no_block!(APP) — fire-and-forget inside an async context.
run_server_no_block_until
run_server_no_block_until!(APP, stop) — fire-and-forget with stop.
run_server_until
run_server_until!(APP, stop) — blocking with user-supplied stop future.

Structs§

AppInUse
Returned by try_combine when an app Arc is still shared; gives both apps back so the caller can retry or fall back.
EmptyError
Template error type for RequestContext::Error.
Locals
String-based extension storage, typically used by application code Multiple values of the same type can be stored with different keys
LocalsClone
String-based extension storage, typically used by application code.
Params
Type-based extension storage, typically used by middleware Each type can have exactly one value
ParamsClone
Type-based extension storage, typically used by middleware.
ProtocolRegistryBuilder
Builder for protocol registries assembled from neutral protocol entries.
TcpAccepter
Plain TCP accepter that wraps accepted Tokio streams.
TcpConnector
Plain TCP outbound connector.
TcpConnectorAddr
TCP connector that accepts a resolved socket address.
TcpInbound
Bound plain TCP inbound runtime.
TcpMeta
Connection metadata for plain TCP.
TcpOutbound
TCP outbound runtime using normal TcpStream::connect.
TcpStream
Tokio TCP stream wrapper owned by hotaru_io_tokio.
TcpTransport
Plain Tokio TCP transport.
TemplateManager
Manages template loading, caching, and rendering
TokioIo
Local Tokio IO adapter owned by hotaru_io_tokio.
TokioRuntime
Tokio-backed runtime. Spawn forwards to tokio::spawn; time/select/sync forward to the matching tokio::* primitives.
WalkCursor
Unstable Version: 0.8.1
WalkFrame
Unstable Version: 0.8.1

Enums§

ConnectionError
FrameNode
Unstable Version: 0.8.1
PathPattern
A single URL path-segment matcher.
ProtocolRegistryKind
Optimization for single-protocol apps, which are common in practice.
ProtocolRole
Role of the protocol handler - server or client.
RunMode
Run mode for framework runtimes.
TimeoutSetting
Controls how long a timeout is, or whether it is active at all.
TokioBackend
Backend tag for Tokio IO values.
Value

Traits§

AsyncMiddleware
ConnStream
Stream abstraction for protocol-specific transports.
DefaultProtocolError
Marker so the blanket impl above does not conflict with hand-written impls that want custom can_continue behaviour. Implement this on types that should get the default can_continue() = false.
EndpointOutcome
Normalizes whatever an endpoint! body evaluates to into an effect on the context. Endpoint’s type-directed counterpart to Protocol::send: implementations are per (context, body-return-type) pair, so each protocol decides which endpoint return values it accepts.
Inbound
Bound inbound runtime that accepts final wire streams.
Message
Protocol-defined message format.
Outbound
Outbound runtime that opens final wire streams.
ParamValue
Object-safe supertrait for stored values.
Protocol
User-defined protocol handler.
ProtocolError
Protocol-defined error. Each protocol owns its own concrete error type.
RequestContext
Context that flows through request handlers.
Stream
Protocol-defined stream abstraction.

Functions§

AnyPath
Creates a any path pattern. This is useful for matching any path. This is faster then regex when any path should be passed into the same endpoint
AnyUrl
Creates a any pattern. You may use this to match any string. This is faster then regex when any string should be passed into the same endpoint
LitUrl
Creates a literal path pattern. This is a wrapper around the literal_path function. This is useful for creating path patterns that are not regex.
RegUrl
Creates a regex path pattern. This is a wrapper around the regex_path function. This is useful for creating path patterns that are regex.
TrailingSlash
Creates a literal empty segment used for trailing slash registration.
combine_hashmap
Helper function to merge two HashMap<K, V> without overwriting existing entries in a.

Type Aliases§

BoxProtocolError
Client
Tokio-backed client alias used by the umbrella crate.
ProtocolHandlerBuilder
Umbrella alias for building protocol handler registries.
Result
Server
Tokio-backed server alias used by the umbrella crate.
Url
Umbrella alias for Hotaru’s URL routing tree.

Attribute Macros§

hrt_ctor
Our own constructor attribute - works like #[ctor::ctor] but built-in Generates platform-specific linker sections for automatic initialization