Skip to main content

rlqt_lib/entry_metadata/
labels.rs

1// Copyright (C) 2025-2026 Michael S. Klishin and Contributors
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.
14use bitflags::bitflags;
15use serde::de::{MapAccess, Visitor};
16use serde::ser::SerializeMap;
17use serde::{Deserialize, Deserializer, Serialize, Serializer};
18use std::fmt::{self, Formatter};
19
20/// Label name constants - single source of truth for label identifiers
21pub const LABEL_UNLABELLED: &str = "unlabelled";
22pub const LABEL_ERL_PROCESS_CRASH: &str = "erl_process_crash";
23pub const LABEL_UNDEFINED_FN: &str = "undefined_fn";
24pub const LABEL_PROCESS_STOPS: &str = "process_stops";
25pub const LABEL_RAFT: &str = "raft";
26pub const LABEL_ELECTIONS: &str = "elections";
27pub const LABEL_QUEUES: &str = "queues";
28pub const LABEL_AUTO_DELETE: &str = "auto_delete";
29pub const LABEL_EXCLUSIVE: &str = "exclusive";
30pub const LABEL_EXCEPTIONS: &str = "exceptions";
31pub const LABEL_DELETE: &str = "delete";
32pub const LABEL_QUEUE_FEDERATION: &str = "queue_federation";
33pub const LABEL_VIRTUAL_HOSTS: &str = "virtual_hosts";
34pub const LABEL_CONNECTIONS: &str = "connections";
35pub const LABEL_ACCESS_CONTROL: &str = "access_control";
36pub const LABEL_SHOVELS: &str = "shovels";
37pub const LABEL_CQ_STORES: &str = "cq_stores";
38pub const LABEL_DISCONNECTS: &str = "disconnects";
39pub const LABEL_FEDERATION: &str = "federation";
40pub const LABEL_DELETION_PROTECTION: &str = "deletion_protection";
41pub const LABEL_MULTILINE: &str = "multiline";
42pub const LABEL_STREAMS: &str = "streams";
43pub const LABEL_LIMITS: &str = "limits";
44pub const LABEL_WORKER_POOL: &str = "worker_pool";
45pub const LABEL_PEER_DISCOVERY_CLASSIC: &str = "peer_discovery:classic";
46pub const LABEL_PLUGINS: &str = "plugins";
47pub const LABEL_EXCHANGES: &str = "exchanges";
48pub const LABEL_STARTUP_BANNER: &str = "startup_banner";
49pub const LABEL_CHANNELS: &str = "channels";
50pub const LABEL_SHUTDOWN: &str = "shutdown";
51pub const LABEL_DEFINITIONS: &str = "definitions";
52pub const LABEL_FEATURE_FLAGS: &str = "feature_flags";
53pub const LABEL_STOMP: &str = "stomp";
54pub const LABEL_WEBSOCKETS: &str = "websockets";
55pub const LABEL_MQTT: &str = "mqtt";
56pub const LABEL_CLUSTERING: &str = "clustering";
57pub const LABEL_METRICS: &str = "metrics";
58pub const LABEL_TLS: &str = "tls";
59pub const LABEL_QUORUM_QUEUES: &str = "quorum_queues";
60pub const LABEL_NETWORKING: &str = "networking";
61pub const LABEL_CLASSIC_QUEUES: &str = "classic_queues";
62pub const LABEL_POLICIES: &str = "policies";
63pub const LABEL_TIMEOUTS: &str = "timeouts";
64pub const LABEL_CONSUMERS: &str = "consumers";
65pub const LABEL_DEPRECATED_FEATURES: &str = "deprecated_features";
66pub const LABEL_MAINTENANCE_MODE: &str = "maintenance_mode";
67pub const LABEL_KHEPRI: &str = "khepri";
68pub const LABEL_RUNTIME_PARAMETERS: &str = "runtime_parameters";
69pub const LABEL_HTTP: &str = "http";
70pub const LABEL_SESSIONS: &str = "sessions";
71pub const LABEL_AMQP10: &str = "amqp10";
72pub const LABEL_OAUTH2: &str = "oauth2";
73pub const LABEL_SQL: &str = "sql";
74pub const LABEL_MNESIA: &str = "mnesia";
75
76/// Array of all label names in the order they were defined
77pub const LABEL_NAMES: &[&str] = &[
78    LABEL_UNLABELLED,
79    LABEL_ERL_PROCESS_CRASH,
80    LABEL_UNDEFINED_FN,
81    LABEL_PROCESS_STOPS,
82    LABEL_RAFT,
83    LABEL_ELECTIONS,
84    LABEL_QUEUES,
85    LABEL_AUTO_DELETE,
86    LABEL_EXCLUSIVE,
87    LABEL_EXCEPTIONS,
88    LABEL_DELETE,
89    LABEL_QUEUE_FEDERATION,
90    LABEL_VIRTUAL_HOSTS,
91    LABEL_CONNECTIONS,
92    LABEL_ACCESS_CONTROL,
93    LABEL_SHOVELS,
94    LABEL_CQ_STORES,
95    LABEL_DISCONNECTS,
96    LABEL_FEDERATION,
97    LABEL_DELETION_PROTECTION,
98    LABEL_MULTILINE,
99    LABEL_STREAMS,
100    LABEL_LIMITS,
101    LABEL_WORKER_POOL,
102    LABEL_PEER_DISCOVERY_CLASSIC,
103    LABEL_PLUGINS,
104    LABEL_EXCHANGES,
105    LABEL_STARTUP_BANNER,
106    LABEL_CHANNELS,
107    LABEL_SHUTDOWN,
108    LABEL_DEFINITIONS,
109    LABEL_FEATURE_FLAGS,
110    LABEL_STOMP,
111    LABEL_WEBSOCKETS,
112    LABEL_MQTT,
113    LABEL_CLUSTERING,
114    LABEL_METRICS,
115    LABEL_TLS,
116    LABEL_QUORUM_QUEUES,
117    LABEL_NETWORKING,
118    LABEL_CLASSIC_QUEUES,
119    LABEL_POLICIES,
120    LABEL_TIMEOUTS,
121    LABEL_CONSUMERS,
122    LABEL_DEPRECATED_FEATURES,
123    LABEL_MAINTENANCE_MODE,
124    LABEL_KHEPRI,
125    LABEL_RUNTIME_PARAMETERS,
126    LABEL_HTTP,
127    LABEL_SESSIONS,
128    LABEL_AMQP10,
129    LABEL_OAUTH2,
130    LABEL_SQL,
131    LABEL_MNESIA,
132];
133
134// Given that a parsed dataset can have 100s of thousands or millions of labels,
135// they are stored using a bitflags representation for efficiency.
136bitflags! {
137    #[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash)]
138    pub struct LogEntryLabels: u64 {
139        const UNLABELLED          = 1 << 0;
140        const ERL_PROCESS_CRASH   = 1 << 1;
141        const UNDEFINED_FN        = 1 << 2;
142        const PROCESS_STOPS       = 1 << 3;
143        const RAFT                = 1 << 4;
144        const ELECTIONS           = 1 << 5;
145        const QUEUES              = 1 << 6;
146        const AUTO_DELETE         = 1 << 7;
147        const EXCLUSIVE           = 1 << 8;
148        const EXCEPTIONS          = 1 << 9;
149        const DELETE              = 1 << 10;
150        const QUEUE_FEDERATION    = 1 << 11;
151        const VIRTUAL_HOSTS       = 1 << 12;
152        const CONNECTIONS         = 1 << 13;
153        const ACCESS_CONTROL      = 1 << 14;
154        const SHOVELS             = 1 << 15;
155        const CQ_STORES           = 1 << 16;
156        const DISCONNECTS         = 1 << 17;
157        const FEDERATION          = 1 << 18;
158        const DELETION_PROTECTION = 1 << 19;
159        const MULTILINE           = 1 << 20;
160        const STREAMS             = 1 << 21;
161        const LIMITS              = 1 << 22;
162        const WORKER_POOL         = 1 << 23;
163        const PEER_DISCOVERY_CLASSIC = 1 << 24;
164        const PLUGINS             = 1 << 25;
165        const EXCHANGES           = 1 << 26;
166        const STARTUP_BANNER      = 1 << 27;
167        const CHANNELS            = 1 << 28;
168        const SHUTDOWN            = 1 << 29;
169        const DEFINITIONS         = 1 << 30;
170        const FEATURE_FLAGS       = 1 << 31;
171        const STOMP               = 1 << 32;
172        const WEBSOCKETS          = 1 << 33;
173        const MQTT                = 1 << 34;
174        const CLUSTERING          = 1 << 35;
175        const METRICS             = 1 << 36;
176        const TLS                 = 1 << 37;
177        const QUORUM_QUEUES       = 1 << 38;
178        const NETWORKING          = 1 << 39;
179        const CLASSIC_QUEUES      = 1 << 40;
180        const POLICIES            = 1 << 41;
181        const TIMEOUTS            = 1 << 42;
182        const CONSUMERS           = 1 << 43;
183        const DEPRECATED_FEATURES = 1 << 44;
184        const MAINTENANCE_MODE    = 1 << 45;
185        const KHEPRI              = 1 << 46;
186        const RUNTIME_PARAMETERS  = 1 << 47;
187        const HTTP                = 1 << 48;
188        const SESSIONS            = 1 << 49;
189        const AMQP10              = 1 << 50;
190        const OAUTH2              = 1 << 51;
191        const SQL                 = 1 << 52;
192        const MNESIA              = 1 << 53;
193    }
194}
195
196impl LogEntryLabels {
197    #[inline]
198    pub fn merge(&mut self, other: Self) {
199        *self |= other;
200    }
201
202    /// Convert to a bitflag value for storage
203    #[inline]
204    pub fn to_bits_i64(self) -> i64 {
205        self.bits() as i64
206    }
207
208    /// Instantiate from a stored bitflag value
209    #[inline]
210    pub fn from_bits_i64(bits: i64) -> Self {
211        Self::from_bits_truncate(bits as u64)
212    }
213
214    /// Convert label name to its bit position
215    #[inline]
216    pub fn bit_for_label(label: &str) -> Option<u64> {
217        match label {
218            LABEL_UNLABELLED => Some(1 << 0),
219            LABEL_ERL_PROCESS_CRASH => Some(1 << 1),
220            LABEL_UNDEFINED_FN => Some(1 << 2),
221            LABEL_PROCESS_STOPS => Some(1 << 3),
222            LABEL_RAFT => Some(1 << 4),
223            LABEL_ELECTIONS => Some(1 << 5),
224            LABEL_QUEUES => Some(1 << 6),
225            LABEL_AUTO_DELETE => Some(1 << 7),
226            LABEL_EXCLUSIVE => Some(1 << 8),
227            LABEL_EXCEPTIONS => Some(1 << 9),
228            LABEL_DELETE => Some(1 << 10),
229            LABEL_QUEUE_FEDERATION => Some(1 << 11),
230            LABEL_VIRTUAL_HOSTS => Some(1 << 12),
231            LABEL_CONNECTIONS => Some(1 << 13),
232            LABEL_ACCESS_CONTROL => Some(1 << 14),
233            LABEL_SHOVELS => Some(1 << 15),
234            LABEL_CQ_STORES => Some(1 << 16),
235            LABEL_DISCONNECTS => Some(1 << 17),
236            LABEL_FEDERATION => Some(1 << 18),
237            LABEL_DELETION_PROTECTION => Some(1 << 19),
238            LABEL_MULTILINE => Some(1 << 20),
239            LABEL_STREAMS => Some(1 << 21),
240            LABEL_LIMITS => Some(1 << 22),
241            LABEL_WORKER_POOL => Some(1 << 23),
242            LABEL_PEER_DISCOVERY_CLASSIC => Some(1 << 24),
243            LABEL_PLUGINS => Some(1 << 25),
244            LABEL_EXCHANGES => Some(1 << 26),
245            LABEL_STARTUP_BANNER => Some(1 << 27),
246            LABEL_CHANNELS => Some(1 << 28),
247            LABEL_SHUTDOWN => Some(1 << 29),
248            LABEL_DEFINITIONS => Some(1 << 30),
249            LABEL_FEATURE_FLAGS => Some(1 << 31),
250            LABEL_STOMP => Some(1 << 32),
251            LABEL_WEBSOCKETS => Some(1 << 33),
252            LABEL_MQTT => Some(1 << 34),
253            LABEL_CLUSTERING => Some(1 << 35),
254            LABEL_METRICS => Some(1 << 36),
255            LABEL_TLS => Some(1 << 37),
256            LABEL_QUORUM_QUEUES => Some(1 << 38),
257            LABEL_NETWORKING => Some(1 << 39),
258            LABEL_CLASSIC_QUEUES => Some(1 << 40),
259            LABEL_POLICIES => Some(1 << 41),
260            LABEL_TIMEOUTS => Some(1 << 42),
261            LABEL_CONSUMERS => Some(1 << 43),
262            LABEL_DEPRECATED_FEATURES => Some(1 << 44),
263            LABEL_MAINTENANCE_MODE => Some(1 << 45),
264            LABEL_KHEPRI => Some(1 << 46),
265            LABEL_RUNTIME_PARAMETERS => Some(1 << 47),
266            LABEL_HTTP => Some(1 << 48),
267            LABEL_SESSIONS => Some(1 << 49),
268            LABEL_AMQP10 => Some(1 << 50),
269            LABEL_OAUTH2 => Some(1 << 51),
270            LABEL_SQL => Some(1 << 52),
271            LABEL_MNESIA => Some(1 << 53),
272            _ => None,
273        }
274    }
275}
276
277impl Serialize for LogEntryLabels {
278    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
279    where
280        S: Serializer,
281    {
282        let mut map = serializer.serialize_map(None)?;
283
284        if self.contains(Self::UNLABELLED) {
285            map.serialize_entry(LABEL_UNLABELLED, &true)?;
286        }
287        if self.contains(Self::ERL_PROCESS_CRASH) {
288            map.serialize_entry(LABEL_ERL_PROCESS_CRASH, &true)?;
289        }
290        if self.contains(Self::UNDEFINED_FN) {
291            map.serialize_entry(LABEL_UNDEFINED_FN, &true)?;
292        }
293        if self.contains(Self::PROCESS_STOPS) {
294            map.serialize_entry(LABEL_PROCESS_STOPS, &true)?;
295        }
296        if self.contains(Self::RAFT) {
297            map.serialize_entry(LABEL_RAFT, &true)?;
298        }
299        if self.contains(Self::ELECTIONS) {
300            map.serialize_entry(LABEL_ELECTIONS, &true)?;
301        }
302        if self.contains(Self::QUEUES) {
303            map.serialize_entry(LABEL_QUEUES, &true)?;
304        }
305        if self.contains(Self::AUTO_DELETE) {
306            map.serialize_entry(LABEL_AUTO_DELETE, &true)?;
307        }
308        if self.contains(Self::EXCLUSIVE) {
309            map.serialize_entry(LABEL_EXCLUSIVE, &true)?;
310        }
311        if self.contains(Self::EXCEPTIONS) {
312            map.serialize_entry(LABEL_EXCEPTIONS, &true)?;
313        }
314        if self.contains(Self::DELETE) {
315            map.serialize_entry(LABEL_DELETE, &true)?;
316        }
317        if self.contains(Self::QUEUE_FEDERATION) {
318            map.serialize_entry(LABEL_QUEUE_FEDERATION, &true)?;
319        }
320        if self.contains(Self::VIRTUAL_HOSTS) {
321            map.serialize_entry(LABEL_VIRTUAL_HOSTS, &true)?;
322        }
323        if self.contains(Self::CONNECTIONS) {
324            map.serialize_entry(LABEL_CONNECTIONS, &true)?;
325        }
326        if self.contains(Self::ACCESS_CONTROL) {
327            map.serialize_entry(LABEL_ACCESS_CONTROL, &true)?;
328        }
329        if self.contains(Self::SHOVELS) {
330            map.serialize_entry(LABEL_SHOVELS, &true)?;
331        }
332        if self.contains(Self::CQ_STORES) {
333            map.serialize_entry(LABEL_CQ_STORES, &true)?;
334        }
335        if self.contains(Self::DISCONNECTS) {
336            map.serialize_entry(LABEL_DISCONNECTS, &true)?;
337        }
338        if self.contains(Self::FEDERATION) {
339            map.serialize_entry(LABEL_FEDERATION, &true)?;
340        }
341        if self.contains(Self::DELETION_PROTECTION) {
342            map.serialize_entry(LABEL_DELETION_PROTECTION, &true)?;
343        }
344        if self.contains(Self::MULTILINE) {
345            map.serialize_entry(LABEL_MULTILINE, &true)?;
346        }
347        if self.contains(Self::STREAMS) {
348            map.serialize_entry(LABEL_STREAMS, &true)?;
349        }
350        if self.contains(Self::LIMITS) {
351            map.serialize_entry(LABEL_LIMITS, &true)?;
352        }
353        if self.contains(Self::WORKER_POOL) {
354            map.serialize_entry(LABEL_WORKER_POOL, &true)?;
355        }
356        if self.contains(Self::PEER_DISCOVERY_CLASSIC) {
357            map.serialize_entry(LABEL_PEER_DISCOVERY_CLASSIC, &true)?;
358        }
359        if self.contains(Self::PLUGINS) {
360            map.serialize_entry(LABEL_PLUGINS, &true)?;
361        }
362        if self.contains(Self::EXCHANGES) {
363            map.serialize_entry(LABEL_EXCHANGES, &true)?;
364        }
365        if self.contains(Self::STARTUP_BANNER) {
366            map.serialize_entry(LABEL_STARTUP_BANNER, &true)?;
367        }
368        if self.contains(Self::CHANNELS) {
369            map.serialize_entry(LABEL_CHANNELS, &true)?;
370        }
371        if self.contains(Self::SHUTDOWN) {
372            map.serialize_entry(LABEL_SHUTDOWN, &true)?;
373        }
374        if self.contains(Self::DEFINITIONS) {
375            map.serialize_entry(LABEL_DEFINITIONS, &true)?;
376        }
377        if self.contains(Self::FEATURE_FLAGS) {
378            map.serialize_entry(LABEL_FEATURE_FLAGS, &true)?;
379        }
380        if self.contains(Self::STOMP) {
381            map.serialize_entry(LABEL_STOMP, &true)?;
382        }
383        if self.contains(Self::WEBSOCKETS) {
384            map.serialize_entry(LABEL_WEBSOCKETS, &true)?;
385        }
386        if self.contains(Self::MQTT) {
387            map.serialize_entry(LABEL_MQTT, &true)?;
388        }
389        if self.contains(Self::CLUSTERING) {
390            map.serialize_entry(LABEL_CLUSTERING, &true)?;
391        }
392        if self.contains(Self::METRICS) {
393            map.serialize_entry(LABEL_METRICS, &true)?;
394        }
395        if self.contains(Self::TLS) {
396            map.serialize_entry(LABEL_TLS, &true)?;
397        }
398        if self.contains(Self::QUORUM_QUEUES) {
399            map.serialize_entry(LABEL_QUORUM_QUEUES, &true)?;
400        }
401        if self.contains(Self::NETWORKING) {
402            map.serialize_entry(LABEL_NETWORKING, &true)?;
403        }
404        if self.contains(Self::CLASSIC_QUEUES) {
405            map.serialize_entry(LABEL_CLASSIC_QUEUES, &true)?;
406        }
407        if self.contains(Self::POLICIES) {
408            map.serialize_entry(LABEL_POLICIES, &true)?;
409        }
410        if self.contains(Self::TIMEOUTS) {
411            map.serialize_entry(LABEL_TIMEOUTS, &true)?;
412        }
413        if self.contains(Self::CONSUMERS) {
414            map.serialize_entry(LABEL_CONSUMERS, &true)?;
415        }
416        if self.contains(Self::DEPRECATED_FEATURES) {
417            map.serialize_entry(LABEL_DEPRECATED_FEATURES, &true)?;
418        }
419        if self.contains(Self::MAINTENANCE_MODE) {
420            map.serialize_entry(LABEL_MAINTENANCE_MODE, &true)?;
421        }
422        if self.contains(Self::KHEPRI) {
423            map.serialize_entry(LABEL_KHEPRI, &true)?;
424        }
425        if self.contains(Self::RUNTIME_PARAMETERS) {
426            map.serialize_entry(LABEL_RUNTIME_PARAMETERS, &true)?;
427        }
428        if self.contains(Self::HTTP) {
429            map.serialize_entry(LABEL_HTTP, &true)?;
430        }
431        if self.contains(Self::SESSIONS) {
432            map.serialize_entry(LABEL_SESSIONS, &true)?;
433        }
434        if self.contains(Self::AMQP10) {
435            map.serialize_entry(LABEL_AMQP10, &true)?;
436        }
437        if self.contains(Self::OAUTH2) {
438            map.serialize_entry(LABEL_OAUTH2, &true)?;
439        }
440        if self.contains(Self::SQL) {
441            map.serialize_entry(LABEL_SQL, &true)?;
442        }
443        if self.contains(Self::MNESIA) {
444            map.serialize_entry(LABEL_MNESIA, &true)?;
445        }
446
447        map.end()
448    }
449}
450
451impl<'de> Deserialize<'de> for LogEntryLabels {
452    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
453    where
454        D: Deserializer<'de>,
455    {
456        struct LabelsVisitor;
457
458        impl<'de> Visitor<'de> for LabelsVisitor {
459            type Value = LogEntryLabels;
460
461            fn expecting(&self, formatter: &mut Formatter) -> fmt::Result {
462                formatter.write_str("a map of label flags")
463            }
464
465            fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
466            where
467                A: MapAccess<'de>,
468            {
469                let mut labels = LogEntryLabels::empty();
470
471                while let Some(key) = map.next_key::<String>()? {
472                    let value: bool = map.next_value()?;
473                    if value {
474                        match key.as_str() {
475                            LABEL_UNLABELLED => labels |= LogEntryLabels::UNLABELLED,
476                            LABEL_ERL_PROCESS_CRASH => labels |= LogEntryLabels::ERL_PROCESS_CRASH,
477                            LABEL_UNDEFINED_FN => labels |= LogEntryLabels::UNDEFINED_FN,
478                            LABEL_PROCESS_STOPS => labels |= LogEntryLabels::PROCESS_STOPS,
479                            LABEL_RAFT => labels |= LogEntryLabels::RAFT,
480                            LABEL_ELECTIONS => labels |= LogEntryLabels::ELECTIONS,
481                            LABEL_QUEUES => labels |= LogEntryLabels::QUEUES,
482                            LABEL_AUTO_DELETE => labels |= LogEntryLabels::AUTO_DELETE,
483                            LABEL_EXCLUSIVE => labels |= LogEntryLabels::EXCLUSIVE,
484                            LABEL_EXCEPTIONS => labels |= LogEntryLabels::EXCEPTIONS,
485                            LABEL_DELETE => labels |= LogEntryLabels::DELETE,
486                            LABEL_QUEUE_FEDERATION => labels |= LogEntryLabels::QUEUE_FEDERATION,
487                            LABEL_VIRTUAL_HOSTS => labels |= LogEntryLabels::VIRTUAL_HOSTS,
488                            LABEL_CONNECTIONS => labels |= LogEntryLabels::CONNECTIONS,
489                            LABEL_ACCESS_CONTROL => labels |= LogEntryLabels::ACCESS_CONTROL,
490                            LABEL_SHOVELS => labels |= LogEntryLabels::SHOVELS,
491                            LABEL_CQ_STORES => labels |= LogEntryLabels::CQ_STORES,
492                            LABEL_DISCONNECTS => labels |= LogEntryLabels::DISCONNECTS,
493                            LABEL_FEDERATION => labels |= LogEntryLabels::FEDERATION,
494                            LABEL_DELETION_PROTECTION => {
495                                labels |= LogEntryLabels::DELETION_PROTECTION
496                            }
497                            LABEL_MULTILINE => labels |= LogEntryLabels::MULTILINE,
498                            LABEL_STREAMS => labels |= LogEntryLabels::STREAMS,
499                            LABEL_LIMITS => labels |= LogEntryLabels::LIMITS,
500                            LABEL_WORKER_POOL => labels |= LogEntryLabels::WORKER_POOL,
501                            LABEL_PEER_DISCOVERY_CLASSIC => {
502                                labels |= LogEntryLabels::PEER_DISCOVERY_CLASSIC
503                            }
504                            LABEL_PLUGINS => labels |= LogEntryLabels::PLUGINS,
505                            LABEL_EXCHANGES => labels |= LogEntryLabels::EXCHANGES,
506                            LABEL_STARTUP_BANNER => labels |= LogEntryLabels::STARTUP_BANNER,
507                            LABEL_CHANNELS => labels |= LogEntryLabels::CHANNELS,
508                            LABEL_SHUTDOWN => labels |= LogEntryLabels::SHUTDOWN,
509                            LABEL_DEFINITIONS => labels |= LogEntryLabels::DEFINITIONS,
510                            LABEL_FEATURE_FLAGS => labels |= LogEntryLabels::FEATURE_FLAGS,
511                            LABEL_STOMP => labels |= LogEntryLabels::STOMP,
512                            LABEL_WEBSOCKETS => labels |= LogEntryLabels::WEBSOCKETS,
513                            LABEL_MQTT => labels |= LogEntryLabels::MQTT,
514                            LABEL_CLUSTERING => labels |= LogEntryLabels::CLUSTERING,
515                            LABEL_METRICS => labels |= LogEntryLabels::METRICS,
516                            LABEL_TLS => labels |= LogEntryLabels::TLS,
517                            LABEL_QUORUM_QUEUES => labels |= LogEntryLabels::QUORUM_QUEUES,
518                            LABEL_NETWORKING => labels |= LogEntryLabels::NETWORKING,
519                            LABEL_CLASSIC_QUEUES => labels |= LogEntryLabels::CLASSIC_QUEUES,
520                            LABEL_POLICIES => labels |= LogEntryLabels::POLICIES,
521                            LABEL_TIMEOUTS => labels |= LogEntryLabels::TIMEOUTS,
522                            LABEL_CONSUMERS => labels |= LogEntryLabels::CONSUMERS,
523                            LABEL_DEPRECATED_FEATURES => {
524                                labels |= LogEntryLabels::DEPRECATED_FEATURES
525                            }
526                            LABEL_MAINTENANCE_MODE => labels |= LogEntryLabels::MAINTENANCE_MODE,
527                            LABEL_KHEPRI => labels |= LogEntryLabels::KHEPRI,
528                            LABEL_RUNTIME_PARAMETERS => {
529                                labels |= LogEntryLabels::RUNTIME_PARAMETERS
530                            }
531                            LABEL_HTTP => labels |= LogEntryLabels::HTTP,
532                            LABEL_SESSIONS => labels |= LogEntryLabels::SESSIONS,
533                            LABEL_AMQP10 => labels |= LogEntryLabels::AMQP10,
534                            LABEL_OAUTH2 => labels |= LogEntryLabels::OAUTH2,
535                            LABEL_SQL => labels |= LogEntryLabels::SQL,
536                            LABEL_MNESIA => labels |= LogEntryLabels::MNESIA,
537                            _ => {}
538                        }
539                    }
540                }
541
542                Ok(labels)
543            }
544        }
545
546        deserializer.deserialize_map(LabelsVisitor)
547    }
548}