# `Masu.Wire`
[🔗](https://github.com/hattoriai/masu/blob/v0.7.0/lib/masu/wire.ex#L1)

A value of your own type, as the browser gets it in a cell: what the
cell shows (formatted by the column's type), what a copy and an export
take, and what a filter of the browser compares.

Masu knows numbers, decimals, dates and times, booleans and text, and a
struct that implements `String.Chars`. For any other struct, implement
this protocol: a rich text that shows its text, a range of days that
shows `2027-03-15/2027-03-20`.

    defimpl Masu.Wire, for: Kotoba.Content do
      def to_wire(content), do: content.text
    end

    defimpl Masu.Wire, for: Koyomi.DateRange do
      def to_wire(range), do: "#{range.from}/#{range.to}"
    end

The value goes to the browser as JSON: give text, a number, a boolean,
or nil. An editor of your own (see the Editors of your own guide) gets
the value as the row has it, not this.

# `t`

```elixir
@type t() :: term()
```

All the types that implement this protocol.

# `to_wire`

```elixir
@spec to_wire(t()) :: String.t() | number() | boolean() | nil
```

The value as the browser gets it.

---

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