Skip to main content

ZeroHookAdapter

Struct ZeroHookAdapter 

Source
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>

Source

pub fn new(inner: H) -> Self

Trait Implementations§

Source§

impl<K, T, H: Send> Send for ZeroHookAdapter<K, T, H>

Available on crate feature typed-tree only.
Source§

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.
Source§

const WATCHES: bool = H::WATCHES

Source§

const NEEDS_OLD_VALUE: bool = H::NEEDS_OLD_VALUE

Source§

const NEEDS_INIT: bool = H::NEEDS_INIT

Source§

const NEEDS_WRITE: bool = H::NEEDS_WRITE

Source§

const EXPIRES: bool = H::EXPIRES

Source§

const TTL_REVISION: u32 = H::TTL_REVISION

Source§

const PROJECTS: bool = H::PROJECTS

Source§

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

Whether this hook declares claims into a unique namespace (T10). Compile-time, so an unclaimed collection’s write path is unchanged.
Source§

const EMITS: bool = H::EMITS

Source§

fn watch_channel(&self) -> Option<&Arc<WatchChannel<K>>>

Source§

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.
Source§

fn deadline(&self, key: &K, value: &[u8]) -> Option<u64>

Source§

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])

Called once per live entry during collection open. Fires after recovery and migration are complete, with the final value. Read more
Source§

fn project( &self, key: &K, _old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut ProjectionSink<'_>, ) -> DbResult<()>

Source§

fn projection_targets(&self) -> Option<&IndexTargets>

Source§

fn projection_limits(&self) -> (usize, usize)

Source§

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).
Source§

fn counter_targets(&self) -> Option<&CounterTargets>

Source§

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.
Source§

fn claim_targets(&self) -> Option<&UniqueTargets>

Source§

fn stream_project( &self, key: &K, old: Option<&[u8]>, new: Option<&[u8]>, sink: &mut EmitSink<'_>, ) -> DbResult<()>

Source§

fn stream_targets(&self) -> Option<&QueueTargets>

Source§

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>
where H: Freeze, PhantomData<fn() -> (K, T)>: Freeze,

§

impl<K, T, H> RefUnwindSafe for ZeroHookAdapter<K, T, H>

§

impl<K, T, H> Unpin for ZeroHookAdapter<K, T, H>
where H: Unpin, PhantomData<fn() -> (K, T)>: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more