openthread/ot/types/message_queue_info.rs
1// Copyright 2026 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::prelude_internal::*;
6
7/// This structure represents message queue info.
8///
9/// Functional equivalent of [`otsys::otMessageQueueInfo`](crate::otsys::otMessageQueueInfo).
10#[derive(Debug, Default, Copy, Clone)]
11#[repr(transparent)]
12pub struct MessageQueueInfo(pub otMessageQueueInfo);
13
14impl_ot_castable!(MessageQueueInfo, otMessageQueueInfo);
15
16impl MessageQueueInfo {
17 /// Number of messages in the queue.
18 pub fn num_messages(&self) -> u16 {
19 self.0.mNumMessages
20 }
21
22 /// Number of buffers.
23 pub fn num_buffers(&self) -> u16 {
24 self.0.mNumBuffers
25 }
26
27 /// Total bytes.
28 pub fn total_bytes(&self) -> u32 {
29 self.0.mTotalBytes
30 }
31}