Skip to main content

Coordinate5D

Struct Coordinate5D 

Source
pub struct Coordinate5D {
    pub x: f32,
    pub y: f32,
    pub z: f32,
    pub w: f32,
    pub v: f32,
}
Expand description

5D holographic coordinate for spatial memory indexing.

Ported from v2’s Rust implementation. Each dimension is normalized to [0.0, 1.0] and derived deterministically from content via Coordinate5D::encode(text).

  • x: semantic axis (content hash byte 0-3)
  • y: semantic axis (content hash byte 4-7)
  • z: semantic axis (content hash byte 8-11)
  • w: temporal weight (recency-based)
  • v: consciousness resonance (importance-based)

Fields§

§x: f32

Semantic axis X (content-derived)

§y: f32

Semantic axis Y (content-derived)

§z: f32

Semantic axis Z (content-derived)

§w: f32

Temporal weight (0 = old, 1 = recent)

§v: f32

Consciousness resonance (0 = low importance, 1 = high)

Implementations§

Source§

impl Coordinate5D

Source

pub const fn new(x: f32, y: f32, z: f32, w: f32, v: f32) -> Self

Create a coordinate from explicit values.

Source

pub fn encode(text: &str) -> Self

Deterministically encode text content into a 5D coordinate.

Uses SHA-256 of the text to derive x, y, z dimensions. The w (temporal) and v (consciousness) dimensions default to 0.5 and should be updated when the memory is created with actual temporal and importance data.

Source

pub const fn from_semantic( x: f32, y: f32, z: f32, temporal_weight: f32, importance: f32, ) -> Self

Create a coordinate from pre-computed semantic scores.

Unlike encode() which uses SHA-256 hash bytes (semantically meaningless), this constructor accepts x/y/z values derived from semantic analysis of the content (e.g., TF-IDF anchor projection). This enables similar content to produce similar coordinates.

Source

pub fn encode_with_context( text: &str, temporal_weight: f32, importance: f32, ) -> Self

Encode text with temporal and importance context.

Source

pub fn distance_to(&self, other: &Self) -> f32

Euclidean distance in 5D space.

Source

pub fn semantic_distance_to(&self, other: &Self) -> f32

Weighted distance — emphasizes semantic dimensions (x, y, z) over temporal (w) and consciousness (v).

Source

pub fn zone(&self) -> Zone

Which zone this coordinate falls into, based on radial distance from the center (0.5, 0.5, 0.5, 0.5, 0.5).

Source

pub fn encode_key(&self) -> Vec<u8> ⓘ

Encode as a sortable composite key for LMDB (20 bytes).

Source

pub const fn decode_key(key: &[u8]) -> Option<Self>

Decode from a composite key.

Trait Implementations§

Source§

impl Clone for Coordinate5D

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Coordinate5D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Coordinate5D

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Coordinate5D

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Coordinate5D

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Coordinate5D

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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