iota_util_mem/
memory_stats_noop.rs

1// Copyright (c) Mysten Labs, Inc.
2// Modifications Copyright (c) 2024 IOTA Stiftung
3// SPDX-License-Identifier: Apache-2.0
4
5// Copyright 2021 Parity Technologies
6//
7// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10// option. This file may not be copied, modified, or distributed
11// except according to those terms.
12
13#[derive(Clone, Debug)]
14pub struct Unimplemented;
15pub use Unimplemented as Error;
16
17#[cfg(feature = "std")]
18impl std::fmt::Display for Unimplemented {
19    fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
20        fmt.write_str("unimplemented")
21    }
22}
23
24#[derive(Clone)]
25pub struct MemoryAllocationTracker {}
26
27impl MemoryAllocationTracker {
28    pub fn new() -> Result<Self, Error> {
29        Err(Error)
30    }
31
32    pub fn snapshot(&self) -> Result<crate::MemoryAllocationSnapshot, Error> {
33        unimplemented!();
34    }
35}