#[repr(u8)]pub enum SegmentRoleHint {
Core = 0,
Extension = 1,
Journal = 2,
Index = 3,
Cache = 4,
Audit = 5,
Shard = 6,
Unclassified = 7,
}Expand description
Segment role classification for migration (mirrors hopper-core SegmentRole).
This is a schema-level copy so hopper-schema can reason about roles without depending on internal details of hopper-core’s segment module.
Variants§
Implementations§
Source§impl SegmentRoleHint
impl SegmentRoleHint
Sourcepub fn from_flags(flags: u16) -> Self
pub fn from_flags(flags: u16) -> Self
Decode role from the upper 4 bits of a segment flags field.
Sourcepub fn must_preserve(self) -> bool
pub fn must_preserve(self) -> bool
Whether data in this segment must survive migration unchanged.
Sourcepub fn is_rebuildable(self) -> bool
pub fn is_rebuildable(self) -> bool
Whether the segment can be zeroed and rebuilt from other on-chain state.
Sourcepub fn is_clearable(self) -> bool
pub fn is_clearable(self) -> bool
Whether the segment can be cleared during migration.
Sourcepub fn is_append_only(self) -> bool
pub fn is_append_only(self) -> bool
Whether the segment is append-only (no in-place mutations).
Sourcepub fn is_immutable(self) -> bool
pub fn is_immutable(self) -> bool
Whether the segment is immutable after initialization (Audit logs).
Sourcepub fn requires_migration_copy(self) -> bool
pub fn requires_migration_copy(self) -> bool
Whether this segment’s data must be copied during migration.
Core and Audit segments contain irreplaceable state that cannot be rebuilt or cleared. Their bytes must survive migration intact.
Sourcepub fn is_safe_to_drop(self) -> bool
pub fn is_safe_to_drop(self) -> bool
Whether this segment can be safely dropped (zeroed) without data loss.
Cache segments hold derived/computed values that can be rebuilt from other on-chain state. Dropping them is always safe.
Trait Implementations§
Source§impl Clone for SegmentRoleHint
impl Clone for SegmentRoleHint
Source§fn clone(&self) -> SegmentRoleHint
fn clone(&self) -> SegmentRoleHint
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 SegmentRoleHint
impl Debug for SegmentRoleHint
Source§impl PartialEq for SegmentRoleHint
impl PartialEq for SegmentRoleHint
Source§fn eq(&self, other: &SegmentRoleHint) -> bool
fn eq(&self, other: &SegmentRoleHint) -> bool
self and other values to be equal, and is used by ==.