network_constants/ipv6.rs
1// This file is part of network-constants. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/network-constants/master/COPYRIGHT. No part of network-constants, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
2// Copyright © 2016 The developers of network-constants. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/network-constants/master/COPYRIGHT.
3
4
5use std::net::Ipv6Addr;
6
7
8// It would be nice to avoid the cost of constructing this, but it's not allowed in a static...
9#[inline(always)]
10pub fn localhost() -> Ipv6Addr
11{
12 Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)
13}
14
15#[inline(always)]
16pub fn unspecified() -> Ipv6Addr
17{
18 Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 0)
19}