Skip to main content

SurfaceNode

Struct SurfaceNode 

Source
pub struct SurfaceNode {
    pub container: Container<Uuid, Address>,
    pub images: BTreeMap<ImageRole, ImageRef>,
}
Expand description

A browsing surface in the kernel’s surface stratum.

The only physical residue outside Container is the D0 image-reference map. Those small, content-addressed experience handles stay here so paint can resolve them without consulting a metadata facet; pixels remain out of line.

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.

Implementations§

Source§

impl SurfaceNode

Source

pub fn image(&self, role: ImageRole) -> Option<&ImageRef>

The image reference held for role, if any.

Source

pub fn favicon(&self) -> Option<&ImageRef>

The favicon reference, if one has been stored.

Source

pub fn preview(&self) -> Option<&ImageRef>

The preview reference, if one has been stored. This is the role the legacy inline thumbnail_png migrates into.

Source

pub fn set_image( &mut self, role: ImageRole, image: ImageRef, ) -> Option<ImageRef>

Attach (or replace) the reference for role, returning any prior one. The pixels must already be in the blob store; the node only carries the handle.

Source

pub fn clear_image(&mut self, role: ImageRole) -> Option<ImageRef>

Drop the reference for role, returning it. The blob itself is left for the orphan-GC pass, per the manifest-deletion doctrine: dropping a reference is not a delete.

Source

pub fn primary_address(&self) -> &Address

Returns the node’s canonical retrieval address (the first address).

Source

pub fn url(&self) -> &str

Returns the canonical retrieval URL string. Convenience over Node::primary_address.

Source

pub fn test_stub(url: &str) -> Self

Trait Implementations§

Source§

impl Clone for SurfaceNode

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 SurfaceNode

Source§

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

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

impl Deref for SurfaceNode

Source§

type Target = Container<Uuid, Address>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for SurfaceNode

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Returns the layout of the type.
Source§

impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

Source§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
Source§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.