Trait SharedHaystack

Source
pub trait SharedHaystack: Haystack + Clone
where Self::Target: Hay,
{ }
Expand description

A Haystack which can be shared and cheaply cloned (e.g. &H, Rc<H>).

If a haystack implements this marker trait, during internal operations the original haystack will be retained in full and cloned, rather than being sliced and splitted. Being a shared haystack allows searcher to see the entire haystack, including the consumed portion.

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<'a, A: Hay + ?Sized + 'a> SharedHaystack for &'a A

Implementors§