ice-rpc 0.3.6

RPC over iceoryx2 shared memory: zero-copy header, rkyv payload, reconnection, discovery and more
Documentation
//! Internal facade consumed by the code generated by `ice-rpc-macros`.
//!
//! Groups the runtime internals the `#[service]` macro depends on, so the
//! stable public API of `ice-rpc` stays small. `#[doc(hidden)]`, and **not**
//! part of the public API: its symbols are semver-exempt for the consumers of
//! `ice-rpc`, but **not** for `ice-rpc-macros`.

// ── Shutdown ────────────────────────────────────────────────────────
pub use crate::shutdown::{clear_ipc_cleanup, register_ipc_cleanup};

// ── Rx vocabulary, wire header and name limits ──────────────────────
pub use crate::types::{
    CORRELATION_ID_LEN, CallContext, EventKind, NodeId, PROTOCOL_VERSION, RpcError, RpcHeader,
    SERVICE_NAME_LEN, Sender, ServiceRef, WireEvent, call_scoped, channel, fmt_correlation_id,
    local_call_scoped, method_id_of, next_correlation_id, now_ns, parse_correlation_id,
    raw_pid_to_u32, service_id_of, unbounded_channel,
};

// The hashers the transport's own maps use, re-exported so `benches/hash_map.rs`
// can price the **shipped** implementation instead of a copy of it.
pub use crate::hash::{FxHasher, IdentityHasher};

// Canonical terminals behind the inherent `Observable` methods.
pub use crate::types::{collect_values, first_event};

// ── Service traits implemented by the generated code ────────────────
// `ServiceInit` stays public: it is the only one a developer implements.
pub use crate::service_traits::{ServiceConsumer, ServiceLifecycle, ServiceNamed};

// ── The JSON contract, both sides ────────────────────────────────────
// One view per service: the macro implements the caller side and calls the host
// side, which registers itself once with `set_json_dispatcher`. Gated behind
// `json` alongside the module itself.
#[cfg(feature = "json")]
pub use crate::json::{
    JSON_CALL_TIMEOUT, JsonCallError, JsonCallEvent, JsonCallStream, JsonDispatcher, JsonInvoker,
    JsonOutcome, JsonResult, ReadMode, dispatch_json, json_dispatcher, read_json,
    set_json_dispatcher,
};

// ── Diagnostics ─────────────────────────────────────────────────────
// The gateway's `version()` reports this instead of a hand-written literal.
pub use crate::VERSION;

// ── Lifecycle ───────────────────────────────────────────────────────
// Escape hatch for contexts the macros cannot cover (N-API gateway, tests).
pub use crate::{
    ShutdownGuard, global_cancel_token, init, init_without_ctrl_c, shutdown_and_release,
    wait_for_shutdown,
};

// ── Plumbing invoked by the generated entry points ──────────────────
pub use crate::{_ProviderService, registry_cancel_token, run_provider_inner};

#[cfg(feature = "http")]
pub use crate::start_http_server;

// ── Publish/subscribe transport ─────────────────────────────────────
// Entry points used by the generated client/server.
pub use crate::transport::{
    BoxResponseFuture, CollectEmitter, DEFAULT_MAX_SLICE_LEN, OwnedEmitter, ResponseEmitter,
    ServiceDispatcher, declare_channel_max_slice_len, decode_aligned, emit_rpc_error, native_call,
    observable_to_responses, register_native_service, serialize_and_call, spawn_native_service,
    start_registered_channels, sweep_orphan_shm_markers,
};

// ── Dependency re-exports used by the generated code ────────────────
// No `futures` here: the codegen never named it, and the oneshot channel it
// used to provide now lives in `ice-rpc-rx::rt::oneshot`.
pub use async_channel;
pub use async_lock;
// Re-exported so the generated `impl` blocks (and the injection on the annotated
// trait) can name `ice_rpc::codegen::async_trait::async_trait`: the attribute macro
// expands to `::core::…` only, so reaching it through this path needs no
// `async-trait` dependency in the service crate.
pub use async_trait;
// The JSON converters are the only generated code that names `base64`. The
// request builder is emitted under `json` alone, but the invoker both JSON
// bridges dispatch to is emitted under `json` **or** `http` — the gateway needs
// it, base64 included, for a service with a `Vec<u8>` argument. Both features
// enable the dependency, so this re-export follows their union, not `json`.
#[cfg(any(feature = "json", feature = "http"))]
pub use base64;
pub use futures_lite;
// The link-time registration surface the generated decoders use. The whole crate
// is re-exported, not just its attribute: the expansion names `linkme` itself
// (`#[linkme(crate = …)]`, the private type-check module), so the generated code
// must be able to reach it without the service crate depending on it. Gated by
// the same feature that emits the decoders.
pub use iceoryx2;
#[cfg(feature = "monitoring")]
pub use linkme;
pub use log;
pub use rkyv;
pub use serde_json;