#[non_exhaustive]pub enum StreamMagic {
V1,
}Expand description
Stream-header magic version dispatch — cross-version forward-compat dispatch surface. Each enum variant maps to a distinct 8-byte ASCII tag at the start of an exported stream; the reader dispatches on the recognised tag to select the corresponding frame-format parser.
V1 (the ARKHEXP1 baseline) is the only currently-reserved
variant. Additional variants (V2 / V3 / …) may be added
alongside this enum and the reader-side recognize lookup. The
#[non_exhaustive] attribute makes the additive expansion
non-breaking for external matchers.
Wire-stability invariant: the byte mapping for V1 is pinned
at *b"ARKHEXP1" (golden hex vector
0x41 0x52 0x4B 0x48 0x45 0x58 0x50 0x31). Any change to the V1
byte pattern is a wire-format break and requires the same
migration mechanism as a new variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1
ARKHEXP1 — wire baseline. Currently the only supported
version.
Implementations§
Source§impl StreamMagic
impl StreamMagic
Sourcepub const fn bytes(self) -> &'static [u8; 8]
pub const fn bytes(self) -> &'static [u8; 8]
Return the 8-byte tag for this version. const fn so callers
can pin the byte pattern at compile time + use the result in
const contexts.
Sourcepub fn recognize(bytes: &[u8; 8]) -> Option<Self>
pub fn recognize(bytes: &[u8; 8]) -> Option<Self>
Recognise a stream-header magic tag — Some(variant) when the
8-byte input matches a supported version, None for any
unknown tag (caller surfaces via
WalExportError::UnsupportedStreamVersion).
Fail-fast posture: this lookup runs against a stack 8-byte array — no heap allocation, no buffer slicing beyond the caller’s already-read header bytes.
Trait Implementations§
Source§impl Clone for StreamMagic
impl Clone for StreamMagic
Source§fn clone(&self) -> StreamMagic
fn clone(&self) -> StreamMagic
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamMagic
impl Debug for StreamMagic
Source§impl PartialEq for StreamMagic
impl PartialEq for StreamMagic
Source§fn eq(&self, other: &StreamMagic) -> bool
fn eq(&self, other: &StreamMagic) -> bool
self and other values to be equal, and is used by ==.impl Copy for StreamMagic
impl Eq for StreamMagic
impl StructuralPartialEq for StreamMagic
Auto Trait Implementations§
impl Freeze for StreamMagic
impl RefUnwindSafe for StreamMagic
impl Send for StreamMagic
impl Sync for StreamMagic
impl Unpin for StreamMagic
impl UnsafeUnpin for StreamMagic
impl UnwindSafe for StreamMagic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.