Skip to main content

Node

Type Alias Node 

Source
pub type Node = SurfaceNode;
Expand description

Compatibility name for a browsing surface.

Aliased Type§

pub struct Node {
    pub container: Container<Uuid, Address>,
    pub images: BTreeMap<ImageRole, ImageRef>,
}

Fields§

§container: Container<Uuid, Address>

The one node substrate. Identity, primary-first addresses, authored content, media type, title, tags, and nested-graph bearing live here.

Deref keeps the Container capability surface direct.

§images: BTreeMap<ImageRole, ImageRef>

Content-addressed preview imagery, keyed by role. The node carries ~40-byte ImageRef handles; the pixels live in the durable blob store under content/image/<hex> (see pandect::image_store).

This is the node-image externalization plan’s phase 2. Inline thumbnail_png / favicon_rgba bytes used to ride here and dominated the graph: at 50k nodes they were 64% of live heap, and the lane-D gate measured them at 18x the snapshot size and 3.8x its load time. A preview is experience, not truth, so it belongs in a bounded, collectable cache rather than in every node forever.

Read through Node::image / Node::favicon / Node::preview rather than indexing the map, so call sites name a role.

Trait Implementations§

Source§

impl Addressed for Node

Source§

fn addresses(&self) -> Vec<Address>

Every address, primary first.
Source§

fn primary_address(&self) -> Option<Address>

The canonical address, or None if the node has none.
Source§

impl ContentBearing for Node

Source§

fn content(&self) -> Option<Hash>

The content hash, or None if the node has no body yet.
Source§

fn media_type(&self) -> Option<&str>

The media type of the content, if known (text/markdown, image/png).
Source§

impl GraphBearing for Node

Source§

fn nested(&self) -> Option<&LogId>

The contained graph’s log identity, or None if this node bears none.
Source§

impl Identified for Node

Source§

type Id = Uuid

The stable identity type.
Source§

fn id(&self) -> &Uuid

This node’s stable identity.
Source§

impl Labeled for Node

Source§

fn title(&self) -> Option<&str>

The display title, if any.
Source§

fn tags(&self) -> Vec<String>

The node’s tags.