triomphe 0.1.16

A fork of std::sync::Arc with some extra functionality and without weak references (originally servo_arc)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::fmt;

/// The error type returned by the fallible (`try_*`) allocation methods of
/// `triomphe` when the underlying allocator fails to allocate or the requested
/// layout overflows.
///
/// This mirrors [`core::alloc::AllocError`].
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct AllocError;

impl fmt::Display for AllocError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.write_str("memory allocation failed")
    }
}

impl core::error::Error for AllocError {}