pub trait SpanText:
Debug
+ Eq
+ Hash
+ Borrow<str>
+ Serialize
+ Default {
// Required methods
fn from_static_str(value: &'static str) -> Self;
fn from_owned(value: String) -> Self;
// Provided method
fn to_bytes_string(&self) -> BytesString { ... }
}Expand description
Trait representing the requirements for a type to be used as a Span “string” type.
Note: Borrow
Required Methods§
fn from_static_str(value: &'static str) -> Self
fn from_owned(value: String) -> Self
Provided Methods§
Sourcefn to_bytes_string(&self) -> BytesString
fn to_bytes_string(&self) -> BytesString
Copies this text into an owned BytesString.
Used by the v0.5 conversion, whose shared dictionary always owns its strings so it
can hold both interned span text and dynamically-built JSON (span links / events).
The default copies the bytes; owned text types (e.g. BytesString) should override
with a cheaper reference-counted clone.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".