Packages
amqp10_common
4.2.1
4.2.1
4.2.0
retired
4.1.6
4.0.3
4.0.3-rc.1
4.0.2
4.0.2-rc.2
4.0.2-rc.1
4.0.1
4.0.0
4.0.0-rc.2
4.0.0-rc.1
3.13.7
3.13.6
3.13.5
3.13.4
3.13.3
3.13.2
3.13.2-rc.1
3.13.1
3.13.0
3.13.0-rc.6
3.13.0-rc.5
3.13.0-rc.4
3.13.0-rc.3
3.13.0-rc.2
3.13.0-rc.1
3.12.14
3.12.13
3.12.12
3.12.11
3.12.10
3.12.9
3.12.8
3.12.7
3.12.6
3.12.5
3.12.4
3.12.3
3.12.2
3.12.1
3.12.0
3.12.0-rc.4
3.12.0-rc.3
3.12.0-rc.2
3.12.0-rc.1
3.11.28
3.11.27
3.11.26
3.11.25
3.11.24
3.11.23
3.11.22
3.11.21
3.11.20
3.11.19
3.11.18
3.11.17
3.11.16
3.11.15
3.11.14
3.11.13
3.11.12
3.11.11
3.11.10
3.11.9
3.11.8
3.11.7
3.11.6
3.11.5
3.11.4
3.11.3
3.11.2
3.11.1
3.11.0
3.11.0-rc.2
3.11.0-rc.1
3.11.0-1
3.10.25
3.10.24
3.10.23
3.10.22
3.10.21
3.10.20
3.10.19
3.10.18
3.10.17
3.10.16
3.10.15
3.10.14
3.10.13
3.10.12
3.10.11
3.10.10
3.10.9
3.10.8
3.10.7
3.10.6
3.10.5
3.10.4
3.10.3
3.10.2
retired
3.10.2-1
3.10.1
retired
3.10.0
retired
3.10.0-rc.6
3.10.0-rc.5
3.10.0-rc.1
3.9.29
3.9.28
3.9.27
3.9.26
3.9.25
3.9.24
3.9.23
3.9.22
3.9.21
3.9.20
3.9.19
3.9.18
retired
3.9.17
3.9.16
3.9.15
3.8.35
3.8.34
3.8.33
3.8.32
3.8.31
3.8.30
0.0.0-rc.1
Modules shared by rabbitmq-amqp1.0 and rabbitmq-amqp1.0-client
Current section
Files
Jump to
Current section
Files
src/amqp10_composite.erl
%% This Source Code Form is subject to the terms of the Mozilla Public
%% License, v. 2.0. If a copy of the MPL was not distributed with this
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
%%
%% Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. All rights reserved.
%%
-module(amqp10_composite).
-include("amqp10_framing.hrl").
-export([flow/2,
transfer/2,
disposition/2,
header/2,
properties/2]).
-spec flow(#'v1_0.flow'{}, nonempty_list()) ->
#'v1_0.flow'{}.
flow(F, [F1, F2, F3, F4]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4)};
flow(F, [F1, F2, F3, F4, F5]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5)};
flow(F, [F1, F2, F3, F4, F5, F6]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6)};
flow(F, [F1, F2, F3, F4, F5, F6, F7]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6),
link_credit = ntu(F7)};
flow(F, [F1, F2, F3, F4, F5, F6, F7, F8]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6),
link_credit = ntu(F7),
available = ntu(F8)};
flow(F, [F1, F2, F3, F4, F5, F6, F7, F8, F9]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6),
link_credit = ntu(F7),
available = ntu(F8),
drain = ntu(F9)};
flow(F, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6),
link_credit = ntu(F7),
available = ntu(F8),
drain = ntu(F9),
echo = ntu(F10)};
flow(F, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11]) ->
F#'v1_0.flow'{next_incoming_id = ntu(F1),
incoming_window = ntu(F2),
next_outgoing_id = ntu(F3),
outgoing_window = ntu(F4),
handle = ntu(F5),
delivery_count = ntu(F6),
link_credit = ntu(F7),
available = ntu(F8),
drain = ntu(F9),
echo = ntu(F10),
properties = amqp10_framing:decode(F11)}.
-spec transfer(#'v1_0.transfer'{}, nonempty_list()) ->
#'v1_0.transfer'{}.
transfer(T, [F1]) ->
T#'v1_0.transfer'{handle = ntu(F1)};
transfer(T, [F1, F2]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2)};
transfer(T, [F1, F2, F3]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3)};
transfer(T, [F1, F2, F3, F4]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4)};
transfer(T, [F1, F2, F3, F4, F5]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5)};
transfer(T, [F1, F2, F3, F4, F5, F6]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6)};
transfer(T, [F1, F2, F3, F4, F5, F6, F7]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6),
rcv_settle_mode = ntu(F7)};
transfer(T, [F1, F2, F3, F4, F5, F6, F7, F8]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6),
rcv_settle_mode = ntu(F7),
state = amqp10_framing:decode(F8)};
transfer(T, [F1, F2, F3, F4, F5, F6, F7, F8, F9]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6),
rcv_settle_mode = ntu(F7),
state = amqp10_framing:decode(F8),
resume = ntu(F9)};
transfer(T, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6),
rcv_settle_mode = ntu(F7),
state = amqp10_framing:decode(F8),
resume = ntu(F9),
aborted = ntu(F10)};
transfer(T, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11]) ->
T#'v1_0.transfer'{handle = ntu(F1),
delivery_id = ntu(F2),
delivery_tag = ntu(F3),
message_format = ntu(F4),
settled = ntu(F5),
more = ntu(F6),
rcv_settle_mode = ntu(F7),
state = amqp10_framing:decode(F8),
resume = ntu(F9),
aborted = ntu(F10),
batchable = ntu(F11)}.
-spec disposition(#'v1_0.disposition'{}, nonempty_list()) ->
#'v1_0.disposition'{}.
disposition(D, [F1, F2]) ->
D#'v1_0.disposition'{role = ntu(F1),
first = ntu(F2)};
disposition(D, [F1, F2, F3]) ->
D#'v1_0.disposition'{role = ntu(F1),
first = ntu(F2),
last = ntu(F3)};
disposition(D, [F1, F2, F3, F4]) ->
D#'v1_0.disposition'{role = ntu(F1),
first = ntu(F2),
last = ntu(F3),
settled = ntu(F4)};
disposition(D, [F1, F2, F3, F4, F5]) ->
D#'v1_0.disposition'{role = ntu(F1),
first = ntu(F2),
last = ntu(F3),
settled = ntu(F4),
state = amqp10_framing:decode(F5)};
disposition(D, [F1, F2, F3, F4, F5, F6]) ->
D#'v1_0.disposition'{role = ntu(F1),
first = ntu(F2),
last = ntu(F3),
settled = ntu(F4),
state = amqp10_framing:decode(F5),
batchable = ntu(F6)}.
-spec header(#'v1_0.header'{}, list()) ->
#'v1_0.header'{}.
header(H, []) ->
H;
header(H, [F1]) ->
H#'v1_0.header'{durable = ntu(F1)};
header(H, [F1, F2]) ->
H#'v1_0.header'{durable = ntu(F1),
priority = ntu(F2)};
header(H, [F1, F2, F3]) ->
H#'v1_0.header'{durable = ntu(F1),
priority = ntu(F2),
ttl = ntu(F3)};
header(H, [F1, F2, F3, F4]) ->
H#'v1_0.header'{durable = ntu(F1),
priority = ntu(F2),
ttl = ntu(F3),
first_acquirer = ntu(F4)};
header(H, [F1, F2, F3, F4, F5]) ->
H#'v1_0.header'{durable = ntu(F1),
priority = ntu(F2),
ttl = ntu(F3),
first_acquirer = ntu(F4),
delivery_count = ntu(F5)}.
-spec properties(#'v1_0.properties'{}, list()) ->
#'v1_0.properties'{}.
properties(P, []) ->
P;
properties(P, [F1]) ->
P#'v1_0.properties'{message_id = ntu(F1)};
properties(P, [F1, F2]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2)};
properties(P, [F1, F2, F3]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3)};
properties(P, [F1, F2, F3, F4]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4)};
properties(P, [F1, F2, F3, F4, F5]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5)};
properties(P, [F1, F2, F3, F4, F5, F6]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6)};
properties(P, [F1, F2, F3, F4, F5, F6, F7]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8, F9]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8),
absolute_expiry_time = ntu(F9)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8),
absolute_expiry_time = ntu(F9),
creation_time = ntu(F10)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8),
absolute_expiry_time = ntu(F9),
creation_time = ntu(F10),
group_id = ntu(F11)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8),
absolute_expiry_time = ntu(F9),
creation_time = ntu(F10),
group_id = ntu(F11),
group_sequence = ntu(F12)};
properties(P, [F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13]) ->
P#'v1_0.properties'{message_id = ntu(F1),
user_id = ntu(F2),
to = ntu(F3),
subject = ntu(F4),
reply_to = ntu(F5),
correlation_id = ntu(F6),
content_type = ntu(F7),
content_encoding = ntu(F8),
absolute_expiry_time = ntu(F9),
creation_time = ntu(F10),
group_id = ntu(F11),
group_sequence = ntu(F12),
reply_to_group_id = ntu(F13)}.
%% null to undefined
-compile({inline, [ntu/1]}).
ntu(null) ->
undefined;
ntu(Other) ->
Other.