Skip to main content

NodeCard

Struct NodeCard 

Source
pub struct NodeCard {
    pub node_id: String,
    pub language: String,
    pub text: String,
    pub source_revision: u64,
    pub source_content_hash: String,
    pub source_record_digest: String,
    pub source_body_bytes: u64,
    pub authored_by: String,
    pub authored_at: String,
    pub card_revision: u64,
}
Expand description

A reader-authored compact view of one node body, in one language.

A card is derived, never canonical. It names the exact body version it was written from — revision and content hash — so a later reader can tell whether it still describes what the store holds, without trusting the prose. Nothing here participates in ranking, path selection or proof; deleting every card changes no answer except the cards themselves.

card_revision is the card’s own compare-and-set token, separate from the node’s revision. Rewriting a card never advances the node.

Fields§

§node_id: String§language: String

Language tag the card is written in. Part of the identity: a Spanish and an English card for one node coexist and neither shadows the other.

§text: String§source_revision: u64

Revision of the node body this card was authored from.

§source_content_hash: String

The public token of that body version, kept for provenance. It is not what validity is decided on: it is derived from the event and the node identity, so a write can change the text without changing it.

§source_record_digest: String

Digest over the exact stored record of that body version. This is the identity a card is bound to, and the one a reuse check compares.

§source_body_bytes: u64

Canonical UTF-8 bytes of the body this card stood in for, recorded at authorship so a reader can see what the card saves without loading it.

§authored_by: String

Writer name recorded at authorship.

§authored_at: String

RFC3339 instant stamped by the kernel, not by the caller. A historical read compares against this so a card cannot appear before it existed.

§card_revision: u64

Implementations§

Source§

impl NodeCard

Source

pub fn stamp(&self) -> NodeCardStamp

Everything a read may disclose about this card when it may not show the prose.

Trait Implementations§

Source§

impl Clone for NodeCard

Source§

fn clone(&self) -> NodeCard

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 NodeCard

Source§

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

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

impl Eq for NodeCard

Source§

impl PartialEq for NodeCard

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NodeCard

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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