count

suspend fun <T> Flow<T>.count(): Int

Returns the number of elements in this flow.


suspend fun <T> Flow<T>.count(predicate: suspend (T) -> Boolean): Int

Returns the number of elements matching the given predicate.