silk.trace.values.

Bounded, owned attribute values used by recorded spans, logs and metrics.

Import as Attributes with import silk.trace.values { Attributes }.

Public declarations: 4.

Text#

silk
pub struct Text

At most 64 UTF-8 bytes, owned by the record.

Implementation Copy for Text#

silk
impl Copy for Text

Implementation Text#

silk
impl Text

Associated function empty#

silk
pub fn empty() -> Self

Returns an empty text value.

Method view#

silk
pub fn view(self: &Self) -> string

Borrows the valid UTF-8 prefix. A scalar split at capacity is omitted.

Associated function render#

silk
pub fn render<Args>(static template: string<'static>, args: &Args) -> Self

Formats a log template into fixed record storage.

Associated function display#

silk
pub fn display<V: Display>(value: &V) -> Self

Formats one displayable attribute into fixed record storage.

Implementation Writer for Text#

silk
impl Writer for Text

Operation writeAll#

silk
writeAll: Text.writeAll

Operation flush#

silk
flush: Text.flush

Value#

silk
pub union Value

An OpenTelemetry scalar, including signed and unsigned Silk integers.

Bool#

silk
Bool

Field value#

silk
pub value: bool

Integer#

silk
Integer

Field value#

silk
pub value: i64

Unsigned#

silk
Unsigned

Field value#

silk
pub value: u64

Double#

silk
Double

Field value#

silk
pub value: f64

Text#

silk
Text

Field value#

silk
pub value: Text

Implementation Copy for Value#

silk
impl Copy for Value

Implementation Value#

silk
impl Value

Associated function capture#

silk
pub fn capture<V>(value: &V) -> Self

Keeps primitive values typed and captures other values through their Display implementation.

Method equivalent#

silk
pub fn equivalent(self: &Self, other: &Self) -> bool

Compares attribute type and value.

Attribute#

silk
pub struct Attribute

One static key and its owned value.

Field key#

silk
pub key: string<'static>

The field or user-supplied key.

Field value#

silk
pub value: Value

The value captured during observation.

Implementation Copy for Attribute#

silk
impl Copy for Attribute

Attributes#

silk
pub struct Attributes

Up to eight distinct keys. Updates to an existing key replace its value.

Field items#

silk
pub items: [Attribute; 8]

Attribute storage. Only the first count entries are populated.

Field count#

silk
pub count: usize

Number of distinct keys captured.

Field dropped#

silk
pub dropped: u64

Number of additional keys omitted at capacity.

Implementation Copy for Attributes#

silk
impl Copy for Attributes

Implementation Attributes#

silk
impl Attributes

Associated function empty#

silk
pub fn empty() -> Self

Creates an empty set.

Method set#

silk
pub fn set<V>(self: &mut Self, static key: string<'static>, value: &V) -> ()

Sets a typed value or increments the dropped count when storage is full.

Method setCaptured#

silk
pub fn setCaptured(self: &mut Self, static key: string<'static>, value: Value) -> ()

Stores an already-captured value, without invoking user formatting.

Method fields#

silk
pub fn fields<Args>(self: &mut Self, args: &Args) -> ()

Collects the named fields of an argument record.

Associated function make#

silk
pub fn make<Args>(args: &Args) -> Self

Captures the named fields of an argument record into a fresh set.

Method equivalent#

silk
pub fn equivalent(self: &Self, other: &Self) -> bool

Compares keys and values independently of insertion order.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page