pub struct MemoryLink {
pub source_id: String,
pub target_id: String,
pub relation: MemoryLinkRelation,
pub created_at: String,
pub signature: Option<Vec<u8>>,
pub observed_by: Option<String>,
pub valid_from: Option<String>,
pub valid_until: Option<String>,
pub attest_level: Option<String>,
}Fields§
§source_id: String§target_id: String§relation: MemoryLinkRelationv0.7.0 fix campaign R1-M4 — typed closed set. Round-trips with
the memory_links.relation TEXT column via
MemoryLinkRelation::as_str (write) / from_str (read). The
SQL CHECK constraint added in migration 0023 enforces the same
membership at the storage layer so direct-SQL writers cannot
bypass the Rust validator.
created_at: String§signature: Option<Vec<u8>>v0.7 H3 — optional 64-byte Ed25519 signature carried over the
federation wire. None for legacy peers (pre-v0.7) that do not
sign outbound links; receivers in that case land the row with
attest_level = "unsigned". When Some, it is verified against
the public key associated with observed_by before insert.
skip_serializing_if keeps the wire shape byte-identical to
pre-H3 for unsigned rows so v0.6.x peers continue to deserialize
without surprise.
observed_by: Option<String>v0.7 H3 — agent_id that asserts this link. Mirrors the H2
SignableLink.observed_by field. Required when signature is
Some (it is the lookup key for the verifying public key);
None is treated as “no claim” and short-circuits to unsigned.
valid_from: Option<String>v0.7 H3 — RFC3339 instant the link became true (matches the
homonymous column in memory_links). Part of the signed bundle;
must round-trip byte-identical with what the sender signed for
verification to succeed.
valid_until: Option<String>v0.7 H3 — RFC3339 instant the link was invalidated, or None if
still valid. Part of the signed bundle.
attest_level: Option<String>v0.7 H4 — attestation level for the row ("unsigned",
"self_signed", "peer_attested"). Populated by readers that
surface the memory_links.attest_level TEXT column (e.g.
db::get_links for the memory_get_links MCP tool). Stays
None on constructors that don’t go through a DB read — those
paths still feed create_link_inbound which derives the column
value from the attest_level: &str parameter. The
skip_serializing_if keeps the wire shape byte-identical to
pre-v0.7 federation peers that don’t carry the column.
Trait Implementations§
Source§impl Clone for MemoryLink
impl Clone for MemoryLink
Source§fn clone(&self) -> MemoryLink
fn clone(&self) -> MemoryLink
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 MemoryLink
impl Debug for MemoryLink
Source§impl<'de> Deserialize<'de> for MemoryLink
impl<'de> Deserialize<'de> for MemoryLink
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for MemoryLink
impl RefUnwindSafe for MemoryLink
impl Send for MemoryLink
impl Sync for MemoryLink
impl Unpin for MemoryLink
impl UnsafeUnpin for MemoryLink
impl UnwindSafe for MemoryLink
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more