pub struct LogBatch<'a> { /* private fields */ }
Expand description
A batch of log records to be exported by a LogExporter
.
The LogBatch
struct holds a collection of log records along with their associated
instrumentation scopes. This structure is used to group log records together for efficient
export operations.
§Type Parameters
'a
: The lifetime of the references to the log records and instrumentation scopes.
Implementations§
source§impl<'a> LogBatch<'a>
impl<'a> LogBatch<'a>
sourcepub fn new(
data: &'a [(&'a LogRecord, &'a InstrumentationScope)],
) -> LogBatch<'a>
pub fn new( data: &'a [(&'a LogRecord, &'a InstrumentationScope)], ) -> LogBatch<'a>
Creates a new instance of LogBatch
.
§Arguments
data
- A slice of tuples, where each tuple consists of a reference to aLogRecord
and a reference to anInstrumentationScope
. These tuples represent the log records and their associated instrumentation scopes to be exported.
§Returns
A LogBatch
instance containing the provided log records and instrumentation scopes.
Note - this is not a public function, and should not be used directly. This would be made private in the future.
source§impl LogBatch<'_>
impl LogBatch<'_>
sourcepub fn iter(&self) -> impl Iterator<Item = (&LogRecord, &InstrumentationScope)>
pub fn iter(&self) -> impl Iterator<Item = (&LogRecord, &InstrumentationScope)>
Returns an iterator over the log records and instrumentation scopes in the batch.
Each item yielded by the iterator is a tuple containing references to a LogRecord
and an InstrumentationScope
.
§Returns
An iterator that yields references to the LogRecord
and InstrumentationScope
in the batch.