Skip to main content

stacktrack_vmo/
lib.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 thiserror::Error;
6
7pub mod threads_table_v1;
8
9#[derive(Debug, Eq, Error, PartialEq)]
10pub enum Error {
11    #[error("The provided memory region is too small")]
12    BufferTooSmall,
13    #[error("The provided memory region is too big")]
14    BufferTooBig,
15    #[error("Operation failed due to lack of space")]
16    OutOfSpace,
17    #[error("Operation failed because the provided input is not valid")]
18    InvalidInput,
19    #[error("System call failed: {}", .0)]
20    SyscallFailed(#[from] zx::Status),
21}
22
23impl From<memory_mapped_vmo::Error> for Error {
24    fn from(error: memory_mapped_vmo::Error) -> Self {
25        match error {
26            memory_mapped_vmo::Error::InvalidInput => Error::InvalidInput,
27        }
28    }
29}