Trait merde::IntoStatic

source ·
pub trait IntoStatic {
    type Output: 'static;

    // Required method
    fn into_static(self) -> Self::Output;
}
Expand description

Allow turning a value into an “owned” variant, which can then be returned, moved, etc.

This usually involves allocating buffers for Cow<'a, str>, etc.

Required Associated Types§

source

type Output: 'static

The “owned” variant of the type. For Cow<'a, str>, this is Cow<'static, str>, for example.

Required Methods§

source

fn into_static(self) -> Self::Output

Turns the value into an “owned” variant, which can then be returned, moved, etc.

This allocates, for all but the most trivial types.

Implementations on Foreign Types§

source§

impl IntoStatic for bool

source§

impl IntoStatic for i8

source§

impl IntoStatic for i16

source§

impl IntoStatic for i32

source§

impl IntoStatic for i64

source§

impl IntoStatic for i128

source§

impl IntoStatic for isize

source§

impl IntoStatic for u8

source§

impl IntoStatic for u16

source§

impl IntoStatic for u32

source§

impl IntoStatic for u64

source§

impl IntoStatic for u128

source§

impl IntoStatic for usize

source§

impl IntoStatic for String

source§

impl<'a, T> IntoStatic for Cow<'a, T>
where T: ToOwned + 'static + ?Sized,

source§

type Output = Cow<'static, T>

source§

fn into_static(self) -> <Cow<'a, T> as IntoStatic>::Output

source§

impl<K, V> IntoStatic for HashMap<K, V>
where K: IntoStatic + Eq + Hash, V: IntoStatic, <K as IntoStatic>::Output: Eq + Hash,

source§

impl<T> IntoStatic for Option<T>
where T: IntoStatic,

source§

impl<T> IntoStatic for VecDeque<T>
where T: IntoStatic,

source§

impl<T> IntoStatic for Vec<T>
where T: IntoStatic,

source§

impl<T> IntoStatic for HashSet<T>
where T: IntoStatic, <T as IntoStatic>::Output: Eq + Hash,

Implementors§

source§

impl IntoStatic for CowStr<'_>

source§

type Output = CowStr<'static>