pub struct NoHook;Expand description
Default no-op hook. All branches are eliminated at compile time.
Trait Implementations§
Source§impl<K: Key, T> TypedWriteHook<K, T> for NoHook
Available on crate feature typed-tree only.
impl<K: Key, T> TypedWriteHook<K, T> for NoHook
Available on crate feature
typed-tree only.Source§const NEEDS_OLD_VALUE: bool = false
const NEEDS_OLD_VALUE: bool = false
Unused for TypedTree/TypedMap/ZeroTree/ZeroMap — old value is always
provided (it lives in memory). Kept for trait uniformity with
WriteHook.const NEEDS_INIT: bool = false
fn on_write(&self, _key: &K, _old: Option<&T>, _new: Option<&T>)
fn on_init(&self, _key: &K, _value: &T)
Source§impl<K: Key> WriteHook<K> for NoHook
impl<K: Key> WriteHook<K> for NoHook
Source§const NEEDS_OLD_VALUE: bool = false
const NEEDS_OLD_VALUE: bool = false
Only affects VarTree / VarMap: when
false, skips disk I/O for the old
value — old is None in on_write. Const/Typed/Zero collections
always provide the old value (it’s in memory, zero cost).Source§const NEEDS_INIT: bool = false
const NEEDS_INIT: bool = false
When
true, Self::on_init is called for every live entry during
collection open (after recovery and migration). When false (default),
the init iteration is compiled out entirely.Auto Trait Implementations§
impl Freeze for NoHook
impl RefUnwindSafe for NoHook
impl Send for NoHook
impl Sync for NoHook
impl Unpin for NoHook
impl UnsafeUnpin for NoHook
impl UnwindSafe for NoHook
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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