rspc_legacy/
lib.rs

1//! The rspc 0.3.1 syntax implemented on top of the 0.4.0 core.
2//!
3//! This allows incremental migration from the old syntax to the new syntax with the minimal breaking changes.
4#![forbid(unsafe_code)]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6#![doc(
7    html_logo_url = "https://github.com/specta-rs/rspc/blob/main/.github/logo.png?raw=true",
8    html_favicon_url = "https://github.com/specta-rs/rspc/blob/main/.github/logo.png?raw=true"
9)]
10
11mod config;
12mod error;
13mod middleware;
14mod resolver;
15mod resolver_result;
16mod router;
17mod router_builder;
18mod selection;
19
20#[cfg_attr(
21    feature = "deprecated",
22    deprecated = "This is replaced by `rspc::Typescript`"
23)]
24pub use config::Config;
25pub use error::{Error, ErrorCode, ExecError, ExportError};
26pub use middleware::{
27    Middleware, MiddlewareBuilder, MiddlewareContext, MiddlewareLike, MiddlewareWithResponseHandler,
28};
29pub use resolver::{typedef, DoubleArgMarker, DoubleArgStreamMarker, Resolver, StreamResolver};
30pub use resolver_result::{FutureMarker, RequestLayer, ResultMarker, SerializeMarker};
31pub use router::{ExecKind, Router};
32pub use router_builder::RouterBuilder;
33
34pub mod internal;
35
36#[cfg_attr(
37    feature = "deprecated",
38    deprecated = "This is no longer going to included. You can copy it into your project if you need it."
39)]
40#[cfg(debug_assertions)]
41#[allow(clippy::panic)]
42pub fn test_result_type<T: specta::Type + serde::Serialize>() {
43    panic!("You should not call `test_type` at runtime. This is just a debugging tool.");
44}
45
46#[cfg_attr(
47    feature = "deprecated",
48    deprecated = "This is no longer going to included. You can copy it into your project if you need it."
49)]
50#[cfg(debug_assertions)]
51#[allow(clippy::panic)]
52pub fn test_result_value<T: specta::Type + serde::Serialize>(_: T) {
53    panic!("You should not call `test_type` at runtime. This is just a debugging tool.");
54}