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>(
        &self,
        value: &T,
        upper_size: usize,
    ) -> Result<Self::InternedStr<'_>, Error>
       where T: Display + ?Sized;

    // 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>( &self, value: &T, upper_size: usize, ) -> Result<Self::InternedStr<'_>, Error>
where T: Display + ?Sized,

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.

Implementations on Foreign Types§

Source§

impl Intern for DroplessInterner

Source§

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

Source§

fn intern_formatted_str<T>( &self, value: &T, upper_size: usize, ) -> Result<<DroplessInterner as Intern>::InternedStr<'_>, Error>
where T: Display + ?Sized,

Source§

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

Source§

impl Intern for Interner

Source§

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

Source§

fn intern_formatted_str<T>( &self, value: &T, upper_size: usize, ) -> Result<<Interner as Intern>::InternedStr<'_>, Error>
where T: Display + ?Sized,

Source§

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

Implementors§

Source§

impl Intern for DefaultInterner

Source§

impl<'gcx> Intern for GlobalCx<'gcx>

Source§

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