allocative/impls/std/
net.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 std::net::IpAddr;
11use std::net::Ipv4Addr;
12use std::net::Ipv6Addr;
13
14use crate::allocative_trait::Allocative;
15use crate::visitor::Visitor;
16
17impl Allocative for IpAddr {
18    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
19        visitor.enter_self_sized::<Self>().exit();
20    }
21}
22
23impl Allocative for Ipv4Addr {
24    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
25        visitor.enter_self_sized::<Self>().exit();
26    }
27}
28
29impl Allocative for Ipv6Addr {
30    fn visit<'a, 'b: 'a>(&self, visitor: &'a mut Visitor<'b>) {
31        visitor.enter_self_sized::<Self>().exit();
32    }
33}