regex_automata::meta::regex

Type Alias CachePoolGuard

Source
type CachePoolGuard<'a> = PoolGuard<'a, Cache, Box<dyn Fn() -> Cache + Send + Sync + UnwindSafe + RefUnwindSafe>>;
Expand description

Same as above, but for the guard returned by a pool.

Aliased Type§

struct CachePoolGuard<'a>(PoolGuard<'a, Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>);

Fields§

§0: PoolGuard<'a, Cache, Box<dyn Fn() -> Cache + UnwindSafe + RefUnwindSafe + Send + Sync>>

Implementations

Source§

impl<'a, T: Send, F: Fn() -> T> PoolGuard<'a, T, F>

Source

pub fn put(this: PoolGuard<'_, T, F>)

Consumes this guard and puts it back into the pool.

This circumvents the guard’s Drop implementation. This can be useful in circumstances where the automatic Drop results in poorer codegen, such as calling non-inlined functions.

Trait Implementations

Source§

impl<'a, T: Send + Debug, F: Fn() -> T> Debug for PoolGuard<'a, T, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a, T: Send, F: Fn() -> T> Deref for PoolGuard<'a, T, F>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'a, T: Send, F: Fn() -> T> DerefMut for PoolGuard<'a, T, F>

Source§

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.