allocative/impls/std/
primitive.rs

1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under both the MIT license found in the
5 * LICENSE-MIT file in the root directory of this source tree and the Apache
6 * License, Version 2.0 found in the LICENSE-APACHE file in the root directory
7 * of this source tree.
8 */
9
10use crate::allocative_trait::Allocative;
11use crate::visitor::Visitor;
12
13impl Allocative for u8 {
14    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
15        visitor.visit_simple_sized::<Self>();
16    }
17}
18
19impl Allocative for u16 {
20    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
21        visitor.visit_simple_sized::<Self>();
22    }
23}
24
25impl Allocative for u32 {
26    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
27        visitor.visit_simple_sized::<Self>();
28    }
29}
30
31impl Allocative for u64 {
32    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
33        visitor.visit_simple_sized::<Self>();
34    }
35}
36
37impl Allocative for usize {
38    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
39        visitor.visit_simple_sized::<Self>();
40    }
41}
42
43impl Allocative for i8 {
44    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
45        visitor.visit_simple_sized::<Self>();
46    }
47}
48
49impl Allocative for i16 {
50    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
51        visitor.visit_simple_sized::<Self>();
52    }
53}
54
55impl Allocative for i32 {
56    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
57        visitor.visit_simple_sized::<Self>();
58    }
59}
60
61impl Allocative for i64 {
62    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
63        visitor.visit_simple_sized::<Self>();
64    }
65}
66
67impl Allocative for isize {
68    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
69        visitor.visit_simple_sized::<Self>();
70    }
71}
72
73impl Allocative for bool {
74    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
75        visitor.visit_simple_sized::<Self>();
76    }
77}
78
79impl Allocative for f32 {
80    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
81        visitor.visit_simple_sized::<Self>();
82    }
83}
84
85impl Allocative for f64 {
86    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
87        visitor.visit_simple_sized::<Self>();
88    }
89}