Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference / API 参考

Status: 62 Crates, 10 Domains / 62 个 Crate,10 个功能域 状态: 全阶段完成 ✅

Hiver provides comprehensive API documentation across multiple channels. Hiver 通过多个渠道提供全面的 API 文档。


Documentation Resources / 文档资源

Resource / 资源Link / 链接Description / 描述
AI-Optimized ReferenceAGENTS.mdCompact LLM-injectable reference (62 crates)
JSON Schemaapi-schema.jsonMachine-parseable API catalog
Full API Referencefull-api-reference.mdHuman-readable with code examples
Annotations Referenceannotations-reference.mdAll 150+ procedural macros
CodemapCODEMAP.mdFull crate reference, dependency graph
docs.rsdocs.rs/hiverAuto-generated rustdoc

Architecture Domains / 架构域

Runtime & Core / 运行时与核心

CrateDescription / 描述
hiver-runtimeCustom async runtime (io-uring/epoll/kqueue)
hiver-coreCore types, error handling
hiver-httpHTTP/1.1 server, Request, Response
hiver-routerRouter with path params, state, middleware
hiver-middlewareMiddleware trait (CORS, compression, timeout)
hiver-extractorsRequest parameter extraction
hiver-responseResponse builders

Data Layer / 数据层

CrateDescription / 描述
hiver-data-commonsRepository traits, Page/Sort, entity metadata
hiver-data-rdbcReactive database client, connection pool, RowMapper
hiver-data-ormActiveRecord, Model derive, QueryBuilder, Relationships, Migrations
hiver-data-redisRedis template, distributed locks, caching
hiver-data-mongodbMongoDB template and repository
hiver-flywayDatabase migration framework
hiver-data-annotations@Entity, @Table, @Column, @Id
hiver-data-macros#[derive(Model)], #[derive(Repository)]

Resilience & Observability / 弹性与可观测性

CrateDescription / 描述
hiver-resilienceCircuit breaker, rate limiter, retry, timeout
hiver-observabilityDistributed tracing, metrics, structured logging

Web3 / 区块链

CrateDescription / 描述
hiver-web3Chain abstraction, wallet, transactions, RPC, smart contracts

IoC & AOP / 控制反转与切面

CrateDescription / 描述
hiver-iocDependency injection container, @Component, @Autowired
hiver-aopAspect-oriented programming, @Aspect

Enterprise / 企业级

CrateDescription / 描述
hiver-securityAuthentication, authorization, password encoding
hiver-validationBean Validation (JSR 380)
hiver-validation-annotations@NotNull, @Size, @Email, @Pattern
hiver-scheduling@Scheduled cron/fixed-rate/delay tasks
hiver-i18nInternationalization, MessageSource

AI & Cloud / AI 与云

CrateDescription / 描述
hiver-aiAI/LLM integration, chat models, embeddings
hiver-agentAI agent framework (Spring AI Agent)
hiver-cloudCloud-native support, service discovery
hiver-wsWebSocket server/client

Tooling & Starter / 工具与启动器

CrateDescription / 描述
hiver-macros150+ procedural macros
hiver-lombok@Data, @Getter, @Setter, @Builder
hiver-retry-macros@Retryable, @Recover
hiver-spelSpring Expression Language engine
hiver-modulithModular monolith support
hiver-starterAuto-configuration, one-line startup
hiver-testTest utilities, TestClient

Quick API Patterns / 常用 API 模式

Server Startup / 启动服务器

use hiver_http::Server;
use hiver_router::Router;

fn main() -> std::io::Result<()> {
    let mut rt = hiver_runtime::Runtime::new()?;
    rt.block_on(async {
        let app = Router::new()
            .get("/", || async { "Hello, Hiver!" });
        Server::bind("0.0.0.0:8080").run(app).await
    })
}

Using Starter / 使用启动器

use hiver_starter::HiverApp;

fn main() -> std::io::Result<()> {
    HiverApp::new()
        .with_router(Router::new().get("/", handler))
        .run()
}

Data Repository / 数据仓库

#![allow(unused)]
fn main() {
use hiver_data_orm::prelude::*;
use hiver_data_annotations::{Entity, Table, Id, Column};

#[derive(Entity, Table, Model)]
#[table_name = "users"]
struct User {
    #[id]
    id: i64,
    #[column]
    name: String,
    email: String,
}

// Auto-generated by #[derive(Repository)]
impl UserRepository {
    async fn find_by_email(&self, email: &str) -> Result<Option<User>> { ... }
    async fn find_by_name_and_email(&self, name: &str, email: &str) -> Result<Vec<User>> { ... }
}
}

Previous / 上一页 | Next / 下一页