class Net::IMAP::ESearchResult

def count; data.assoc("COUNT")&.last end

+IMAP4rev2+ {[RFC9051]}[https://www.rfc-editor.org/rfc/rfc9051.html#section-7.3.4].
Requires +ESEARCH+ {[RFC4731]}[https://www.rfc-editor.org/rfc/rfc4731.html#section-3.1] or

the +COUNT+ return option wasn't specified.
Returns +nil+ when the associated search command has no results, or when

Returns the number of messages that satisfy the SEARCH criteria.

:call-seq: count -> integer or nil
def count;      data.assoc("COUNT")&.last      end