Struct LogBatch
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§
§impl<'a> LogBatch<'a>
impl<'a> LogBatch<'a>
pub 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 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.
§impl LogBatch<'_>
impl LogBatch<'_>
pub 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.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for LogBatch<'a>
impl<'a> RefUnwindSafe for LogBatch<'a>
impl<'a> Send for LogBatch<'a>
impl<'a> Sync for LogBatch<'a>
impl<'a> Unpin for LogBatch<'a>
impl<'a> UnwindSafe for LogBatch<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more