Skip to main content

rocketmq_protocol/protocol/
header_codec.rs

1// Copyright 2026 The RocketMQ Rust Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Typed runtime primitives shared by request-header codec implementations.
16//!
17//! This module deliberately exposes only protocol-reviewed wire value types and
18//! protocol-owned sinks. Both extension traits are sealed so adding a Rust type
19//! or sink cannot silently expand RocketMQ wire semantics in another crate.
20
21mod codec;
22mod error;
23mod field_source;
24mod json_field_source;
25mod json_writer;
26mod schema;
27mod sink;
28mod value;
29
30mod private {
31    pub trait Sealed {}
32    pub trait FieldSourceSealed {}
33}
34
35pub(crate) use crate::ProtocolContractViolation;
36pub use codec::HeaderCodec;
37#[doc(hidden)]
38pub use error::into_error;
39pub(crate) use field_source::BinaryHeaderFields;
40pub use field_source::HeaderFieldSource;
41pub(crate) use json_field_source::JsonHeaderFields;
42pub(crate) use json_writer::write_json_string;
43pub use schema::AliasConflictPolicy;
44pub use schema::DynamicCollisionPolicy;
45pub use schema::FlattenPresenceSpec;
46pub use schema::HeaderFieldSpec;
47pub use schema::HeaderFlattenSpec;
48pub use schema::HeaderPresence;
49pub use schema::ResolvedHeaderKey;
50pub use sink::BinarySink;
51pub use sink::EncodeSink;
52pub use sink::JsonSink;
53pub use sink::MapSink;
54pub use value::validate_unsigned_java_range;
55pub use value::HeaderFieldContext;
56pub use value::HeaderRange;
57pub use value::HeaderValue;
58pub use value::HeaderValueKind;