pub struct DetachedItem<T> { /* private fields */ }Expand description
A detached handle to a match candidate.
Unlike an Item, which has a lifetime tied to the Snapshot or Injector from which it was
created, a DetachedItem owns a handle to the underlying data and will persist even if the original
Nucleo matcher has been dropped.
Similarly to an injector, holding this handle will prevent the underlying data from being dropped. This handle is internally reference counted and can be cloned cheaply.
This handle implements PartialEq regardless of the value T. Equality is tested by checking that
both items originate from the same matcher and that the internal indices are the same.
Implementations§
Source§impl<T> DetachedItem<T>
impl<T> DetachedItem<T>
Trait Implementations§
Source§impl<T> Clone for DetachedItem<T>
impl<T> Clone for DetachedItem<T>
Auto Trait Implementations§
impl<T> Freeze for DetachedItem<T>
impl<T> RefUnwindSafe for DetachedItem<T>where
T: RefUnwindSafe,
impl<T> Send for DetachedItem<T>
impl<T> Sync for DetachedItem<T>
impl<T> Unpin for DetachedItem<T>
impl<T> UnsafeUnpin for DetachedItem<T>
impl<T> UnwindSafe for DetachedItem<T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more