# ipnet::IpBitOr - Rust
API documentation for the Rust `IpBitOr` trait in crate `ipnet`.
Keywords: rust, rustlang, rust-lang, IpBitOr

# [−] [src] Trait ipnet::IpBitOr

    pub trait IpBitOr<RHS = Self> {
        type Output;
        fn bitor(self, rhs: RHS) -> Self::Output;
    }

Provides a `bitor()` method for `Ipv4Addr` and `Ipv6Addr`.

# Examples

    use std::net::{Ipv4Addr, Ipv6Addr};
    use ipnet::IpBitOr;

    let ip: Ipv4Addr = "10.1.1.1".parse().unwrap();
    let mask: Ipv4Addr = "0.0.0.255".parse().unwrap();
    let res: Ipv4Addr = "10.1.1.255".parse().unwrap();

    assert_eq!(ip.bitor(mask), res);
    assert_eq!(ip.bitor(0x000000ff), res);

    let ip: Ipv6Addr = "fd00::1".parse().unwrap();
    let mask: Ipv6Addr = "::ffff:ffff".parse().unwrap();
    let res: Ipv6Addr = "fd00::ffff:ffff".parse().unwrap();

    assert_eq!(ip.bitor(mask), res);
    assert_eq!(ip.bitor(u128::from(0xffffffffu32)), res);

## Associated Types

### `type Output` [src]

Loading content...

## Required methods

### `fn bitor(self, rhs: RHS) -> Self::Output` [src]

Loading content...

## Implementations on Foreign Types

### `impl IpBitOr<Ipv4Addr> for Ipv4Addr` [src]

#### `type Output = Ipv4Addr`

#### `fn bitor(self, rhs: Ipv4Addr) -> Ipv4Addr` [src]

### `impl IpBitOr<u32> for Ipv4Addr` [src]

#### `type Output = Ipv4Addr`

#### `fn bitor(self, rhs: u32) -> Ipv4Addr` [src]

### `impl IpBitOr<Ipv6Addr> for Ipv6Addr` [src]

#### `type Output = Ipv6Addr`

#### `fn bitor(self, rhs: Ipv6Addr) -> Ipv6Addr` [src]

### `impl IpBitOr<u128> for Ipv6Addr` [src]

#### `type Output = Ipv6Addr`

#### `fn bitor(self, rhs: u128) -> Ipv6Addr` [src]

Loading content...

## Implementors

Loading content...