pub struct ZeroHookAdapter<K, T, H> { /* private fields */ }Expand description
Adapter: wraps a TypedWriteHook<K, T> and implements WriteHook<K>
by converting raw bytes to &T via zerocopy. Used by ZeroTree/ZeroMap
so their users get typed hook callbacks.
Implementations§
Source§impl<K, T, H> ZeroHookAdapter<K, T, H>
impl<K, T, H> ZeroHookAdapter<K, T, H>
Trait Implementations§
impl<K, T, H: Send> Send for ZeroHookAdapter<K, T, H>
Available on crate feature
typed-tree only.impl<K, T, H: Sync> Sync for ZeroHookAdapter<K, T, H>
Available on crate feature
typed-tree only.Source§impl<K: Key, T: Copy + FromBytes, H: TypedWriteHook<K, T>> WriteHook<K> for ZeroHookAdapter<K, T, H>
Available on crate feature typed-tree only.
impl<K: Key, T: Copy + FromBytes, H: TypedWriteHook<K, T>> WriteHook<K> for ZeroHookAdapter<K, T, H>
Available on crate feature
typed-tree only.const WATCHES: bool = H::WATCHES
const NEEDS_OLD_VALUE: bool = H::NEEDS_OLD_VALUE
const NEEDS_INIT: bool = H::NEEDS_INIT
const NEEDS_WRITE: bool = H::NEEDS_WRITE
const EXPIRES: bool = H::EXPIRES
const TTL_REVISION: u32 = H::TTL_REVISION
const PROJECTS: bool = H::PROJECTS
Source§const COUNTS: bool = H::COUNTS
const COUNTS: bool = H::COUNTS
Whether this hook maintains engine counters. Compile-time, so an
uncounted collection’s write path is unchanged.
Source§const CLAIMS: bool = H::CLAIMS
const CLAIMS: bool = H::CLAIMS
Whether this hook declares claims into a unique namespace (T10).
Compile-time, so an unclaimed collection’s write path is unchanged.
const EMITS: bool = H::EMITS
fn watch_channel(&self) -> Option<&Arc<WatchChannel<K>>>
Source§fn watch_old(&self) -> bool
fn watch_old(&self) -> bool
Whether the watch carrier requests the previous value in published
events. Kept separate from
NEEDS_OLD_VALUE, which may be true only
for an unrelated write hook.fn deadline(&self, key: &K, value: &[u8]) -> Option<u64>
Source§fn on_write(&self, key: &K, old: Option<&[u8]>, new: Option<&[u8]>)
fn on_write(&self, key: &K, old: Option<&[u8]>, new: Option<&[u8]>)
Called after a successful write operation. Read more
Source§fn on_init(&self, key: &K, value: &[u8])
fn on_init(&self, key: &K, value: &[u8])
Called once per live entry during collection open.
Fires after recovery and migration are complete, with the final value. Read more
fn project( &self, key: &K, _old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut ProjectionSink<'_>, ) -> DbResult<()>
fn projection_targets(&self) -> Option<&IndexTargets>
fn projection_limits(&self) -> (usize, usize)
Source§fn counter_project(
&self,
key: &K,
_old: Option<&[u8]>,
new: Option<&[u8]>,
sink: &mut CounterSink<'_>,
) -> DbResult<()>
fn counter_project( &self, key: &K, _old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut CounterSink<'_>, ) -> DbResult<()>
Byte-snapshot counter projection — mirrors
WriteHook::project’s
shape (key, old snapshot, new snapshot, sink).fn counter_targets(&self) -> Option<&CounterTargets>
Source§fn claim_project(
&self,
key: &K,
_old: Option<&[u8]>,
new: Option<&[u8]>,
sink: &mut ClaimSink<'_>,
) -> DbResult<()>
fn claim_project( &self, key: &K, _old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut ClaimSink<'_>, ) -> DbResult<()>
Byte-snapshot claim projection — mirrors
WriteHook::project’s shape.fn claim_targets(&self) -> Option<&UniqueTargets>
fn stream_project( &self, key: &K, old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut EmitSink<'_>, ) -> DbResult<()>
fn stream_targets(&self) -> Option<&QueueTargets>
Source§fn ttl_decode_failed(&self, _value: &[u8]) -> bool
fn ttl_decode_failed(&self, _value: &[u8]) -> bool
True when
value bytes cannot be decoded for TTL stage-2 (Var families).
Distinguishes decode errors from a None policy deadline.Auto Trait Implementations§
impl<K, T, H> Freeze for ZeroHookAdapter<K, T, H>
impl<K, T, H> RefUnwindSafe for ZeroHookAdapter<K, T, H>
impl<K, T, H> Unpin for ZeroHookAdapter<K, T, H>
impl<K, T, H> UnsafeUnpin for ZeroHookAdapter<K, T, H>
impl<K, T, H> UnwindSafe for ZeroHookAdapter<K, T, H>
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