ToStatic

Trait ToStatic 

Source
pub trait ToStatic: Clone {
    type Static: 'static + Clone + Send + Sync;

    // Required method
    fn to_static(&self) -> Self::Static;
}
Expand description

A trait for converting types with lifetime parameters to equivalent types with ’static lifetime.

Required Associated Types§

Source

type Static: 'static + Clone + Send + Sync

The same type but with ’static lifetime and owned data.

Required Methods§

Source

fn to_static(&self) -> Self::Static

Converts this type to the equivalent type with ’static lifetime.

This method creates owned copies of any borrowed data, allowing the resulting type to be used in contexts that require ’static lifetime.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ToStatic for Cow<'_, str>

Available on crate feature alloc only.
Source§

type Static = Cow<'static, str>

Source§

fn to_static(&self) -> Self::Static

Implementors§

Source§

impl ToStatic for TelemetryMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for TracingMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for Value<'_>

Available on crate feature alloc only.
Source§

type Static = Value<'static>

Source§

impl ToStatic for InstanceMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for LogMessage<'_>

Available on crate feature alloc only.
Source§

type Static = LogMessage<'static>

Source§

impl ToStatic for SpanAddEventMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for SpanCreateMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for SpanSetAttributeMessage<'_>

Available on crate feature alloc only.
Source§

impl ToStatic for KeyValue<'_>

Available on crate feature alloc only.
Source§

type Static = KeyValue<'static>

Source§

impl ToStatic for AttributeListType<'_>

Available on crate feature alloc only.
Source§

type Static = Cow<'static, [KeyValue<'static>]>