HaystackSlice

Trait HaystackSlice 

Source
pub trait HaystackSlice<'a>:
    Sized
    + Debug
    + Clone {
    type Item: HaystackItem;
}
Expand description

A trait representing a slice of the underlying haystack for various Haystack types.

The implementor of this trait is usually but not always, the only implementor of IntoHaystack for a haystack type.

It should be noted that this trait is often implemented of a reference to the type in question, e.g. &str or &[u8] rather than str or [u8] themselves, so that the implementing type can be cloned as required.

Required Associated Types§

Source

type Item: HaystackItem

The HaystackItem contained within this slice.

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> HaystackSlice<'a> for &'a str

Source§

impl<'a> HaystackSlice<'a> for &'a BStr

Source§

impl<'a> HaystackSlice<'a> for &'a [u8]

Source§

impl<'a> HaystackSlice<'a> for Substr

Source§

impl<'a, B> HaystackSlice<'a> for HipByt<'a, B>
where B: Backend,

Source§

impl<'a, B> HaystackSlice<'a> for HipStr<'a, B>
where B: Backend,

Implementors§