# `Membrane.Debug.Sink`
[🔗](https://github.com/membraneframework/membrane-core/blob/v1.3.0/lib/membrane/debug/sink.ex#L1)

Membrane Sink, that can be used to create a child that will be used to debug data flowing thouth pipeline.

Usage example:
```elixir
child(:source, CustomSource)
|> child(:sink, %Membrane.Debug.Sink{
  handle_buffer: &IO.inspect(&1, label: "buffer"),
  handle_event: &IO.inspect(&1, label: "event")
})
```

## Element options

Passed via struct `t:Membrane.Debug.Sink.t/0`

- `handle_start_of_stream`  

  ```
  (-> any())
  ```
  
  Default value: `&Membrane.Debug.Sink.noop/0`  
  Function with arity 0, that will be called when the start of stream is received on the input pad.
  Result of this function is ignored.

- `handle_buffer`  

  ```
  (Buffer.t() -> any())
  ```
  
  Default value: `&Membrane.Debug.Sink.noop/1`  
  Function with arity 1, that will be called with all buffers handled by this sink.
  Result of this function is ignored.

- `handle_event`  

  ```
  (Event.t() -> any())
  ```
  
  Default value: `&Membrane.Debug.Sink.noop/1`  
  Function with arity 1, that will be called with all events handled by this sink.
  Result of this function is ignored.

- `handle_stream_format`  

  ```
  (StreamFormat.t() -> any())
  ```
  
  Default value: `&Membrane.Debug.Sink.noop/1`  
  Function with arity 1, that will be called with all stream formats handled by this sink.
  Result of this function is ignored.

- `handle_end_of_stream`  

  ```
  (-> any())
  ```
  
  Default value: `&Membrane.Debug.Sink.noop/0`  
  Function with arity 0, that will be called when the end of stream is received on the input pad.
  Result of this function is ignored.

## Pads

### `:input`

Accepted formats:
```
_any
```

Direction: | `:input`
Availability: | `:always`
Flow control: | `:auto`

# `t`

```elixir
@type t() :: %Membrane.Debug.Sink{
  handle_buffer: (Membrane.Buffer.t() -&gt; any()),
  handle_end_of_stream: (-&gt; any()),
  handle_event: (Membrane.Event.t() -&gt; any()),
  handle_start_of_stream: (-&gt; any()),
  handle_stream_format: (Membrane.StreamFormat.t() -&gt; any())
}
```

Struct containing options for `Membrane.Debug.Sink`

# `noop`

```elixir
@spec noop(any()) :: :ok
```

# `options`

```elixir
@spec options() :: keyword()
```

Returns description of options available for this module

---

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