pub struct ScriptedTelemetrySink { /* private fields */ }Expand description
In-memory scripted telemetry sink fixture for SDK conformance tests. Use it to script deterministic behavior in memory; any transcript or endpoint mutation is documented on the method that performs it.
Implementations§
Source§impl ScriptedTelemetrySink
impl ScriptedTelemetrySink
Sourcepub fn new(spec: TelemetrySinkSpec) -> Self
pub fn new(spec: TelemetrySinkSpec) -> Self
Creates a new testing::telemetry value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn sink_spec(&self) -> &TelemetrySinkSpec
pub fn sink_spec(&self) -> &TelemetrySinkSpec
Returns the sink spec currently held by this value. This configures deterministic in-memory test state only.
Sourcepub fn fail_next(&self, summary: impl Into<String>)
pub fn fail_next(&self, summary: impl Into<String>)
Builds the fail next value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn exports(&self) -> Vec<TelemetryProjection>
pub fn exports(&self) -> Vec<TelemetryProjection>
Returns the exports currently held by this value. This configures deterministic in-memory test state only.
Trait Implementations§
Source§impl Clone for ScriptedTelemetrySink
impl Clone for ScriptedTelemetrySink
Source§fn clone(&self) -> ScriptedTelemetrySink
fn clone(&self) -> ScriptedTelemetrySink
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl TelemetrySink for ScriptedTelemetrySink
impl TelemetrySink for ScriptedTelemetrySink
Source§fn spec(&self) -> &TelemetrySinkSpec
fn spec(&self) -> &TelemetrySinkSpec
Returns spec for the current value.
This is a read-only or data-construction helper unless the method body explicitly calls
a port or store.
Source§fn export(
&self,
projection: &TelemetryProjection,
cursor: &TelemetryExportCursor,
) -> Result<TelemetrySinkAck, TelemetrySinkError>
fn export( &self, projection: &TelemetryProjection, cursor: &TelemetryExportCursor, ) -> Result<TelemetrySinkAck, TelemetrySinkError>
Exports one telemetry projection at the supplied export cursor.
Implementations may write to a telemetry backend, but must not mutate
run state, decide policy, or request raw content beyond the projection.
Auto Trait Implementations§
impl Freeze for ScriptedTelemetrySink
impl RefUnwindSafe for ScriptedTelemetrySink
impl Send for ScriptedTelemetrySink
impl Sync for ScriptedTelemetrySink
impl Unpin for ScriptedTelemetrySink
impl UnsafeUnpin for ScriptedTelemetrySink
impl UnwindSafe for ScriptedTelemetrySink
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
Mutably borrows from an owned value. Read more