pub struct SegmentData { /* private fields */ }pipeline only.Expand description
Data flowing through the processor pipeline.
The driver reads the sealed segment into payload, populates initial
metadata, then passes this through each SegmentProcessor in order.
SegmentData is intentionally !Clone: it is moved through the pipeline
and dropped exactly once, which is crucial for in-flight byte accounting
(a single Drop decrements the counters).
Implementations§
Source§impl SegmentData
impl SegmentData
Sourcepub fn segment(&self) -> &SegmentRef
pub fn segment(&self) -> &SegmentRef
Information about the sealed segment being processed.
Sourcepub fn take_payload(&mut self) -> Payload
pub fn take_payload(&mut self) -> Payload
Take ownership of the payload, leaving an empty Payload in its place.
Sourcepub fn set_payload(&mut self, payload: impl Into<Payload>)
pub fn set_payload(&mut self, payload: impl Into<Payload>)
Replace the payload.
Sourcepub fn set_compressed_size(&mut self, bytes: u64)
pub fn set_compressed_size(&mut self, bytes: u64)
Record the segment’s post-compression size. Surfaces as the
CompressedSize metric for this segment.
Sourcepub fn compressed_size(&self) -> Option<u64>
pub fn compressed_size(&self) -> Option<u64>
The post-compression size reported by a processor, if any.
Sourcepub fn metadata(&self) -> &HashMap<String, String>
pub fn metadata(&self) -> &HashMap<String, String>
Metadata accumulated by upstream processors.
Sourcepub fn metadata_mut(&mut self) -> &mut HashMap<String, String>
pub fn metadata_mut(&mut self) -> &mut HashMap<String, String>
Mutable reference to the metadata map. Processors can insert keys
(e.g. "content_encoding", "write_back_extension") to signal
downstream stages.
Sourcepub fn adjust_accounting(&mut self)
pub fn adjust_accounting(&mut self)
Update memory-mode in-flight accounting to the current payload size. No-op for disk-backed segments.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SegmentData
impl RefUnwindSafe for SegmentData
impl Send for SegmentData
impl Sync for SegmentData
impl Unpin for SegmentData
impl UnsafeUnpin for SegmentData
impl UnwindSafe for SegmentData
Blanket Implementations§
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<V, F> ValueFormatter<&V> for F
impl<V, F> ValueFormatter<&V> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &&V)
fn format_value(writer: impl ValueWriter, value: &&V)
value to writerSource§impl<V, F> ValueFormatter<Arc<V>> for F
impl<V, F> ValueFormatter<Arc<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Arc<V>)
fn format_value(writer: impl ValueWriter, value: &Arc<V>)
value to writerSource§impl<V, F> ValueFormatter<Box<V>> for F
impl<V, F> ValueFormatter<Box<V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Box<V>)
fn format_value(writer: impl ValueWriter, value: &Box<V>)
value to writerSource§impl<V, F> ValueFormatter<Cow<'_, V>> for F
impl<V, F> ValueFormatter<Cow<'_, V>> for F
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)
value to writerSource§impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
impl<V, F> ValueFormatter<Option<V>> for Fwhere
F: ValueFormatter<V> + ?Sized,
Source§const SHAPE: FieldShape<'static>
const SHAPE: FieldShape<'static>
metrique_require_explicit_impls only.Source§fn format_value(writer: impl ValueWriter, value: &Option<V>)
fn format_value(writer: impl ValueWriter, value: &Option<V>)
value to writer