# class RMail::StreamParser

The `RMail::StreamParser` is a low level message parsing API. It is useful when you are interested in serially examining all message content but are not interested in a full object representation of the object. See `StreamParser.parse`.

### Public Class Methods

parse(input, handler) click to toggle source

Parse a message from an input source. This method returns nothing. Instead, the supplied `handler` is expected to implement the same methods as `RMail::StreamHandler`. The message structure can be inferred from the methods called on the `handler`. The `input` can be any Ruby IO source or a String.

This is a low level parsing API. For a message parser that returns an `RMail::Message` object, see the `RMail::Parser` class. `RMail::Parser` is implemented using `RMail::StreamParser`.

    # File lib/rmail/parser.rb, line 169
    def parse(input, handler)
      RMail::StreamParser.new(input, handler).parse
    end