Skip to main content

Crate zerodds_grpc_bridge

Crate zerodds_grpc_bridge 

Source
Expand description

Crate zerodds-grpc-bridge. Safety classification: STANDARD.

gRPC-over-HTTP/2 + gRPC-Web wire codec — pure-Rust no_std + alloc, forbid(unsafe_code). Implements the gRPC-specific wire elements that sit above the HTTP/2 stack: length-prefixed message (LPM), path parsing, timeout header, status codes, custom-metadata encoding (incl. the -bin suffix convention), gRPC-Web trailer frames and a gRPC server skeleton for caller-configured HTTP/2 listeners.

Spec: gRPC HTTP/2 Protocol (length-prefixed message + path + timeout + status + custom metadata) + gRPC-Web Specification (trailer frame + content types).

§Layer position

Layer 5 — bridges. Sits on zerodds-http2 (RFC 9113 framing + stream state + flow control) and zerodds-hpack (RFC 7541 header compression). The HTTP/2 connection lifecycle and HEADERS/CONTINUATION encoding come from these substrate crates; gRPC-bridge concentrates on the gRPC application-layer wire format.

§Public API (Stand 1.0.0-rc.1)

§Example

use zerodds_grpc_bridge::{decode_message, encode_message};

let msg = b"hello-grpc";
let wire = encode_message(msg, false).expect("encode");
let (flag, payload, consumed) = decode_message(&wire).expect("decode");
assert_eq!(flag, 0);
assert_eq!(payload, msg);
assert_eq!(consumed, wire.len());

Re-exports§

pub use frame::FrameError;
pub use frame::decode_message;
pub use frame::encode_message;
pub use metadata::BIN_SUFFIX;
pub use metadata::MetadataError;
pub use metadata::content_types;
pub use metadata::decode_base64;
pub use metadata::decode_header_value;
pub use metadata::encode_base64;
pub use metadata::encode_header_value;
pub use metadata::is_binary_header;
pub use metadata::request_headers;
pub use metadata::response_headers;
pub use path::PathError;
pub use path::parse_path;
pub use server::GrpcRequest;
pub use server::GrpcResponse;
pub use server::GrpcServer;
pub use status::Status;
pub use timeout::TimeoutError;
pub use timeout::TimeoutUnit;
pub use timeout::decode_timeout;
pub use timeout::encode_timeout;

Modules§

bridge_security
gRPC bridge §7.x bridge-security wireup.
daemon_runtime
Cross-cutting daemon runtime for the gRPC daemon.
frame
gRPC Length-Prefixed-Message — Spec §“Requests” + §“Responses”.
metadata
Custom-Metadata encoding per the gRPC spec.
path
gRPC HTTP :path parsing — Spec §“Call-Definition”.
qos_translation
§6 — DDS QoS → gRPC behavior translation.
reflection
gRPC Server Reflection Service (grpc.reflection.v1alpha.ServerReflection).
server
gRPC-over-HTTP/2 server skeleton.
service_gen
Auto-generation of gRPC service definitions per DDS topic.
status
gRPC grpc-status Codes — Spec §“Status”.
timeout
gRPC grpc-timeout Header — Spec §“Timeout”.