Skip to content

Releases

0.8.6

Choose a tag to compare

@Redstone-D Redstone-D released this 26 Aug 11:13
930673c
pict
  • Bug fix for Hotaru Core and Hotaru Trans
  • Rejects ambiguous HTTP/1 request framing, including conflicting Content-Length values and Content-Length combined with Transfer-Encoding.
  • Rejects oversized lengths and chunk-size accumulation overflow before they can cross configured HttpSafety limits.
  • Corrects chunk extension and trailer parsing, rejects unsupported transfer codings, and keeps trailer fields from replacing the request start line.
  • Parses Connection as a case-insensitive token list across repeated fields and applies the HTTP/1.0 and HTTP/1.1 persistence defaults, with close taking precedence.
  • Adds focused HTTP regression coverage for these boundary and persistence cases.

0.8.5

Choose a tag to compare

@Redstone-D Redstone-D released this 12 Aug 13:48
7db7cf68-ebaa-476f-a306-4521ff4c1321
  • Made automatic endpoint/outpoint registration optional through the default-on auto-reg feature. Macro-generated constructors can be bound explicitly with App::bind or Blueprint::bind when it is disabled.
  • Added an experimental manual endpoint-definition path using Endpoint::<P>::endpoint(...) and App::insert, without requiring an endpoint DSL feature.
  • Added focused starters for default macro registration, macro syntax without auto-reg, and manual endpoint construction.
  • Updated CLI scaffolds to use synchronous run_server!(APP) and removed the redundant direct tokio dependency from generated manifests.
  • Refactored HTTP body processing around the typed BodyError model, including explicit missing, oversized, incomplete, invalid, unsupported, and backend-I/O failures.
  • Bounded HTTP line parsing and compressed-body expansion using configured HttpSafety limits, addressing unbounded line reads and decompression growth.
  • Added protocol-neutral TransferOutcome and TransferTermination types for reporting ConditionReached, SourceEnded, and CapReached without converting normal stopping events into backend errors.
  • Added bounded read_to_end, read_until, and read_line operations with explicitly named unbounded variants.
  • Added corresponding write-side count, delimiter, line, and capped helpers. read_exact and write_all remain strict operations that report incomplete backend transfers through Self::Error.
  • Removed the framework error-construction trait; concrete I/O implementations retain ownership of their associated Self::Error.

0.8.3

Choose a tag to compare

@Redstone-D Redstone-D released this 02 Jul 08:59
9a154c0
  • Core/backend split: hotaru_core is now backend-neutral at the public type layer. Concrete Tokio runtime and TCP/IO implementations moved into sibling crates (hotaru_rt_tokio, hotaru_io_tokio), while the umbrella hotaru crate keeps the familiar Tokio defaults.
  • IO adapter crates: futures-io and embedded-io-async adapters moved out of core into hotaru_io_futures and hotaru_io_embedded. Each backend uses local wrapper types (TokioIo<T>, FuturesIo<T>, EmbeddedIo<T>) so adapter impls stay additive and avoid trait-coherence conflicts.
  • Simpler hotaru_core features: core no longer owns io_*, rt_*, tokio, or embassy feature flags. It now keeps only the platform axis (std / embedded) and task-mobility axis (spawn_send / spawn_local); runtime and IO backends are selected through backend crates, or through the std-only hotaru umbrella (Tokio and futures backends only — the embedded backend is consumed directly).
  • hotaru umbrella is std-only: the umbrella no longer re-exports hotaru_io_embedded or exposes embedded / io_embedded features (its prelude pulls std-only items such as std::thread::sleep and once_cell::sync::Lazy). hotaru_io_embedded is not published in 0.8.3 (targeted 0.8.5+); once it ships, no_std / bare-metal projects will depend on hotaru_core + hotaru_io_embedded directly.
  • Runtime abstraction cleanup: RuntimeSpec is the backend-neutral runtime trait, with Tokio implemented externally by hotaru_rt_tokio::TokioRuntime. Framework types (Server, Client, builders, and URL/protocol-entry types) now carry explicit transport/runtime parameters in core, while hotaru restores ergonomic defaults.
  • MaybeSend task-mobility model: async framework surfaces use MaybeSend so spawn_send builds keep real Send bounds and spawn_local builds can support local !Send futures. hotaru_io_embedded gates its actual embedded-io-async trait impls on spawn_local, not on the embedded platform flag.
  • Framework-owned async IO traits: HotaruRead, HotaruWrite, HotaruBufRead, HotaruBufWrite, HotaruIOError, HotaruBufReader, and HotaruBufWriter provide the common IO trait surface used by transports and protocols without hardcoding Tokio types in core.
  • Native async trait surfaces: core transport/protocol traits use return-position impl Future instead of async-trait, reducing proc-macro dependency surface and avoiding unnecessary boxed futures at trait boundaries.
  • Protocol-agnostic endpoint outcomes: EndpointOutcome<C> lets generated endpoints apply return values to any request context. HTTP keeps the existing HttpResponse endpoint style, while non-HTTP/inbound-only protocols can use () outcomes without placeholder responses.
  • Per-protocol URL parsing hooks: Protocol can customize URL tokenization/literal parsing, and URL parser internals such as RawToken, TypeKind, tokenize, and tokens_to_patterns are re-exported for protocol-specific routing work.
  • Preferred-language middleware: htmstd adds PreferredLanguageMiddleware, PreferredLanguage, settings, and request-extension helpers for parsing and negotiating the Accept-Language header.
  • no_std preparation: core continues moving toward no_std readiness with alloc usage, core imports, Akari lite/no_std alignment, generic IO errors, and backend-neutral abstractions. Real Embassy wiring remains deferred; embedded support is still experimental.
  • Sync-main entry macros: run_server! / run_server_until! (blocking) and run_server_no_block! / run_server_no_block_until! (fire-and-forget) let users run a server from an ordinary fn main() — no #[tokio::main], no async fn main. Backed by a new BlockingRuntimeCap capability trait implemented by TokioRuntime.

0.8.2

Choose a tag to compare

@Redstone-D Redstone-D released this 01 Jun 07:48

The first release version for 0.8!

  • Client / outpoint runtime: new Client<TS> for outbound traffic, mirroring Server<TS>. Paired with the outpoint! macro (client-side counterpart to endpoint!) and run! / call! invocation-style sugar for one-shot and persistent outbound calls.
  • Protocol trait reshape: channel-based open_channel / handle / send, plus per-protocol install_channel bridge. type Context: RequestContext<Channel = Self::Channel> pins channel-type alignment. New Channel trait + ProtocolFlow give per-exchange close semantics (HTTP/1 closes the connection; multiplexed protocols may close only the stream).
  • RequestContext rework: Default supertrait; type Channel as a type anchor; inject_request / into_response added. type Error: ProtocolError is the single source of truth for chain errors, and now also requires From<std::io::Error> (since the client path surfaces transport-level I/O). Use the new EmptyError for prototypes / no-payload protocols.
  • Result-typed execution chain: middleware, final handlers, ExecutionChain::run, and UrlNode::run all return Result<C, <C as RequestContext>::Error> — no boxing at the chain boundary.
  • Named access points: every registered endpoint/outpoint has an explicit name. ProtocolEntry::register(name, path, step_names, binding, config) is the single canonical funnel; Server::url(url, name, ...) / Client::url(url, name, ...) are URL-first.
  • Instance-based transports: TransportSpec::Inbound / Outbound replace the old Accepter / Connector shape. TcpInbound::bind(target) and TcpOutbound::build(target) materialize once per Server / Client.
  • HTTPS feature: new https cargo feature on the umbrella hotaru crate forwards to hotaru_http/tls, surfacing HTTPS, TlsTransport, TlsOutboundTarget, TlsClientConfig. HTTPS = Http1Protocol<TlsStream, TlsTransport>.
  • LServer! / LClient! / LUrl! / LPattern! macros: replace the old LApp! for simplified lazy-static declarations. Default to TcpTransport.
  • Bug fixes

0.7.7-patch1

Choose a tag to compare

@JerrySu5379 JerrySu5379 released this 31 Jan 01:43
526633f
  • Added utility methods (get_config, get_static, get_config_or_default, get_static_or_default) to the App struct in hotaru_core to simplify access to configuration and static data in a thread-safe manner, supporting the new database and cache integrations.
  • Bumped hotaru_core version to 0.7.8 to reflect these new capabilities.

0.7.7

Choose a tag to compare

@Redstone-D Redstone-D released this 14 Jan 01:18
  • Fn-style blocks: New syntax pub fn name(req: HTTP) { ... } for endpoint! and middleware! macros (original hotaru blocks syntax preserved)
  • Client IP access: req.client_ip(), req.client_ip_only(), req.server_addr() and related methods for accessing socket addresses in handlers
  • Bug fix for URL routing

Snapshot: 26w02a

Snapshot: 26w02a Pre-release
Pre-release

Choose a tag to compare

@Redstone-D Redstone-D released this 05 Jan 16:37

A new syntax is introduced:

use hotaru_meta::endpoint;

endpoint! {
    APP.url("/api/users"),
    pub fn handle_users(req: HTTP) {
        text_response("User list")
    }
}
use hotaru_meta::middleware;

middleware! {
    pub fn AuthMiddleware(req: HTTP) {
        // Middleware implementation
    }
}

New syntax is called fn-style blocks, where old syntax still preserved and named hotaru blocks.

First Snapshot!

First Snapshot! Pre-release
Pre-release

Choose a tag to compare

@Redstone-D Redstone-D released this 30 Dec 06:08

Access client IP addresses and connection details directly from your handlers:

endpoint! {
    APP.url("/api/whoami"),
    pub whoami<HTTP> {
        // Get client's full socket address (IP + port)
        match req.client_ip() {
            Some(addr) => text_response(format!("Your address: {}", addr)),
            None => text_response("Unknown client"),
        }
    }
}

Available Methods:

Method Return Type Description
client_ip() Option<SocketAddr> Client's socket address (IP + port)
client_ip_or_default() SocketAddr Returns 0.0.0.0:0 if unknown
client_ip_only() Option<IpAddr> Just the IP address, no port
client_ip_only_or_default() IpAddr Returns 0.0.0.0 if unknown
server_addr() Option<SocketAddr> Server's bound address
remote_addr() Option<SocketAddr> Alias for client_ip()
local_addr() Option<SocketAddr> Alias for server_addr()

Note: When behind a reverse proxy, client_ip() returns the proxy's address. Use headers like X-Forwarded-For or X-Real-IP to get the original client IP.

0.7.6

Choose a tag to compare

@Redstone-D Redstone-D released this 30 Dec 06:01
[1] Now the worker() function for APP is now useful

The .worker() method now properly configures the number of worker threads for the application. Each App instance creates its own independent tokio runtime with the specified worker count when run() is called. This setting is independent of any outer runtime configuration.

#[tokio::main]
async fn main() {
    let app = App::new()
        .worker(4)  // App runs with 4 dedicated worker threads
        .binding("127.0.0.1:3000")
        .build();
    app.run().await;
}
[2] LApp!, LUrl!, and LPattern! macros are available for simplified lazy static declarations

New convenience macros simplify creating lazy static instances with less boilerplate:

use hotaru::prelude::*;

// Old way
pub static APP: SApp = Lazy::new(|| {
    App::new().build()
});

// New way with LApp! macro
LApp!(APP = App::new().build());

// Also works for URLs and patterns
LUrl!(HOME_URL = Url::new("/home"));
LPattern!(API_PATTERN = PathPattern::new("/api/*"));

The L prefix stands for "Lazy/Load" - these macros automatically wrap your expression in Lazy::new(|| ...) and create a public static with the appropriate type (SApp, SUrl, SPattern).

Benefits:

  • Less boilerplate - no manual Lazy::new(|| ...) wrapper
  • Clear intent - LApp! immediately signals "lazy app instance"
  • Consistent pattern across all lazy static declarations
  • Educational - shows the assignment pattern while hiding ceremony
[3] Bug Fixes in hotaru new and hotaru init commands

Fixed template generation issues in the hotaru CLI tool:

  • Fixed old macro usage: The generated template now uses the correct endpoint! macro syntax instead of the old syntax #[url] attribute
  • Updated to use LApp!: Generated projects now use LApp!(APP = App::new().build()) for cleaner initialization
  • Improved template structure: The hello world template now follows current best practices with proper imports and macro usage

Generated projects now compile successfully out of the box without manual fixes.

[4] Built-in constructor implementation in hotaru_meta

Hotaru now includes its own implementation of the constructor pattern (similar to the ctor crate) to ensure projects compile without additional dependencies.

By default, Hotaru uses a built-in constructor implementation that supports Linux, macOS, and Windows. This is production-ready and convenient for most use cases.

If you encounter any issues or want the battle-tested ctor crate instead, you can switch to the external implementation:

[dependencies]
hotaru = { version = "0.7.6", features = ["external-ctor"] }
ctor = "0.4.0"  # Required when using external-ctor feature

The built-in implementation is provided for convenience and is production-ready for the supported platforms. However, if you experience any platform-specific issues, switching to the external ctor crate is recommended.