Skip to main content

Intern

Trait Intern 

Source
pub trait Intern {
    type InternedStr<'a>: AsRef<str> + Borrow<str> + Clone + Eq + Ord + Hash + Debug + Display
       where Self: 'a;

    // Required method
    fn intern_formatted_str<T: Display + ?Sized>(
        &self,
        value: &T,
        upper_size: usize,
    ) -> StdResult<Self::InternedStr<'_>, Error>;

    // Provided method
    fn intern_str(&self, text: &str) -> Self::InternedStr<'_> { ... }
}

Required Associated Types§

Source

type InternedStr<'a>: AsRef<str> + Borrow<str> + Clone + Eq + Ord + Hash + Debug + Display where Self: 'a

Required Methods§

Source

fn intern_formatted_str<T: Display + ?Sized>( &self, value: &T, upper_size: usize, ) -> StdResult<Self::InternedStr<'_>, Error>

Provided Methods§

Source

fn intern_str(&self, text: &str) -> Self::InternedStr<'_>

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.

Implementors§

Source§

impl Intern for DroplessInterner

Source§

type InternedStr<'a> = Interned<'a, str> where Self: 'a

Source§

impl Intern for Interner

Source§

type InternedStr<'a> = Interned<'a, str> where Self: 'a