# `Linx.MAC`
[🔗](https://github.com/oshlabs/linx/blob/v0.2.0/lib/linx/mac.ex#L1)

A 48-bit MAC (link-layer) address.

## Construction

    iex> Linx.MAC.parse("00:11:22:33:44:55")
    {:ok, ~MAC"00:11:22:33:44:55"}

## The `~MAC` sigil

`import Linx.MAC` and build MAC literals at compile time:

    iex> import Linx.MAC
    iex> ~MAC"02:aa:bb:cc:dd:ee"
    ~MAC"02:aa:bb:cc:dd:ee"

## Inspect

A MAC renders as the same sigil that would build it —
`~MAC"02:aa:bb:cc:dd:ee"` — so iex output round-trips into source.

## Wire codec

`encode/1` and `decode/1` are the `Linx.Netlink.Codec` entry points: a
`Linx.MAC` serializes to its 6 raw bytes; decode reads 6 bytes back.

# `t`

```elixir
@type t() :: %Linx.MAC{bytes: &lt;&lt;_::48&gt;&gt;}
```

# `parse`

```elixir
@spec parse(binary()) :: {:ok, t()} | {:error, term()}
```

Parses a colon-separated hex string into an `Linx.MAC`.

# `sigil_MAC`
*macro* 

The `~MAC` sigil: builds a `Linx.MAC` at compile time. Invalid input
raises `ArgumentError`.

# `to_string`

```elixir
@spec to_string(t()) :: binary()
```

Renders a `Linx.MAC` as a colon-separated hex string.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
