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 SdkLogRecord, &'a InstrumentationScope)],
) -> LogBatch<'a>
pub fn new( data: &'a [(&'a SdkLogRecord, &'a InstrumentationScope)], ) -> LogBatch<'a>
Creates a new instance of LogBatch.
§Arguments
data- A slice of tuples, where each tuple consists of a reference to aLogRecordand 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 = (&SdkLogRecord, &InstrumentationScope)>
pub fn iter( &self, ) -> impl Iterator<Item = (&SdkLogRecord, &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.