1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2024 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use zx::Handle;

use crate::DecodeError;

/// A decoder which support Zircon handles.
pub trait HandleDecoder {
    /// Takes the next handle from the decoder.
    fn take_handle(&mut self) -> Result<Handle, DecodeError>;

    /// Returns the number of handles remaining in the decoder.
    fn handles_remaining(&mut self) -> usize;
}