pub struct TraceLine {Show 13 fields
pub schema: String,
pub schema_version: u32,
pub trace_id: String,
pub span_id: String,
pub parent_span_id: Option<String>,
pub name: String,
pub kind: SpanKind,
pub start_unix_nanos: u64,
pub end_unix_nanos: u64,
pub status: SpanStatus,
pub attributes: BTreeMap<String, TraceAttr>,
pub events: Vec<TraceEvent>,
pub resource: Option<TraceResource>,
}Expand description
One span, one line (3.10.1).
Fields§
§schema: String§schema_version: u32The span schema version, 1 for rustev.otel/1.
trace_id: String32 lowercase hex digits.
span_id: String16 lowercase hex digits.
parent_span_id: Option<String>16 lowercase hex digits, or null for a root without a host parent.
name: String§kind: SpanKind§start_unix_nanos: u64§end_unix_nanos: u64§status: SpanStatus§attributes: BTreeMap<String, TraceAttr>§events: Vec<TraceEvent>§resource: Option<TraceResource>Implementations§
Source§impl TraceLine
impl TraceLine
Sourcepub fn parse_line(bytes: &[u8]) -> Result<Self, TraceLineError>
pub fn parse_line(bytes: &[u8]) -> Result<Self, TraceLineError>
Parse one line (without its newline) under TRACE_V1 and check it.
Sourcepub fn check(&self) -> Result<(), TraceLineError>
pub fn check(&self) -> Result<(), TraceLineError>
The line’s invariants: the span schema version is
SPAN_SCHEMA_VERSION, ids are non-zero lowercase hex of their
length, the name is a span name of 3.5.1, the end is not before the
start, only a root (a line with resource) carries the resource,
every value is well formed, and the withheld list is present.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TraceLine
impl<'de> Deserialize<'de> for TraceLine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Document for TraceLine
impl Document for TraceLine
Source§const LIMITS: ParseLimits = TRACE_V1
const LIMITS: ParseLimits = TRACE_V1
The limit set its bytes are scanned against (spec 002, 3.2.5).
Source§fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
fn parse(bytes: &[u8]) -> Result<Self, DocumentError>
Scan, deserialize and check the schema string.
Source§fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
fn record_canonical(&self) -> Result<Vec<u8>, CanonicalError>where
Self: PartialEq,
The record canonical bytes (spec 004, 5.6): the canonical bytes, with
finite fractional numbers written in shortest round-trip form.
Source§fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
fn record_digest(&self) -> Result<ContentDigest, CanonicalError>where
Self: PartialEq,
sha256(SCHEMA || 0x00 || record canonical bytes) (spec 004, 3.1.6).
Equal to the identity of an identified document.Source§impl JsonSchema for TraceLine
impl JsonSchema for TraceLine
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for TraceLine
Auto Trait Implementations§
impl Freeze for TraceLine
impl RefUnwindSafe for TraceLine
impl Send for TraceLine
impl Sync for TraceLine
impl Unpin for TraceLine
impl UnsafeUnpin for TraceLine
impl UnwindSafe for TraceLine
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