pub struct SpanBuilder {
pub span: Span,
}Expand description
In-flight span being assembled between on_*_start and on_*_end.
Pure data; no behavior — TracingHandler drives it.
Fields§
§span: SpanThe span being assembled. ended_at, output, level, status_message,
and (for Generation) generation are filled at close time.
Implementations§
Source§impl SpanBuilder
impl SpanBuilder
Sourcepub fn open(
run_id: Uuid,
parent_run_id: Option<Uuid>,
trace_id: Uuid,
kind: SpanKind,
name: impl Into<String>,
input: Option<Value>,
now: SystemTime,
) -> Self
pub fn open( run_id: Uuid, parent_run_id: Option<Uuid>, trace_id: Uuid, kind: SpanKind, name: impl Into<String>, input: Option<Value>, now: SystemTime, ) -> Self
Open a new span at now.
Sourcepub fn finish_ok(self, output: Option<Value>, now: SystemTime) -> Span
pub fn finish_ok(self, output: Option<Value>, now: SystemTime) -> Span
Mark the span ended successfully and stamp the output.
Sourcepub fn finish_error(self, message: impl Into<String>, now: SystemTime) -> Span
pub fn finish_error(self, message: impl Into<String>, now: SystemTime) -> Span
Mark the span ended with an error.
Sourcepub fn with_generation(self, gen: Generation) -> Self
pub fn with_generation(self, gen: Generation) -> Self
Attach a populated Generation payload (used on on_llm_end).
Trait Implementations§
Source§impl Clone for SpanBuilder
impl Clone for SpanBuilder
Source§fn clone(&self) -> SpanBuilder
fn clone(&self) -> SpanBuilder
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 moreAuto Trait Implementations§
impl Freeze for SpanBuilder
impl RefUnwindSafe for SpanBuilder
impl Send for SpanBuilder
impl Sync for SpanBuilder
impl Unpin for SpanBuilder
impl UnsafeUnpin for SpanBuilder
impl UnwindSafe for SpanBuilder
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