Skip to main content

ComponentTemplateArtifact

Struct ComponentTemplateArtifact 

Source
pub struct ComponentTemplateArtifact {
    pub tag_name: String,
    pub template: String,
    pub template_json: String,
    pub template_functions: String,
    pub hydration: StateSurface,
    pub navigation: StateSurface,
    pub template_roots: Vec<String>,
    pub is_scripted: bool,
    pub uses_shadow_dom: bool,
}
Expand description

Client template payload generated by a parser plugin for one component.

Fields§

§tag_name: String

Component custom-element tag name.

§template: String

Plugin-owned client template payload.

§template_json: String

WebUI JSON-safe template metadata.

§template_functions: String

WebUI component-local JavaScript condition closure array.

§hydration: StateSurface

Initial hydration state surface derived by the producing plugin.

§navigation: StateSurface

Partial-navigation state surface derived by the producing plugin.

§template_roots: Vec<String>

Compiled template roots — the reactive property names referenced directly by the template (e.g. {{name}}) independent of any authored client script. Always populated (possibly empty), even when hydration/navigation collapse to StateSurface::All, so a bundler-neutral manifest consumer can union exact client keys with these Rust-derived roots without re-deriving them.

§is_scripted: bool

Whether this component has an authored client module (sibling script or an externally client-owned package), as opposed to a scriptless compiled template. Bundler manifest coverage validation only requires an entry for scripted components; scriptless ones are always Rust-derived and never require a manifest entry.

§uses_shadow_dom: bool

Whether this component effectively uses Shadow DOM.

Implementations§

Source§

impl ComponentTemplateArtifact

Source

pub fn template( tag_name: String, template: String, uses_shadow_dom: bool, ) -> Self

Create a non-WebUI template payload.

Source

pub fn webui( tag_name: String, template_json: String, template_functions: String, uses_shadow_dom: bool, ) -> Self

Create a WebUI split metadata/function payload.

The hydration surface starts empty; the producing plugin attaches it with Self::with_hydration once it has derived the surface.

Source

pub fn with_hydration(self, hydration: StateSurface) -> Self

Attach the initial hydration surface derived by the plugin.

Source

pub fn with_navigation(self, navigation: StateSurface) -> Self

Attach the partial-navigation surface derived by the plugin.

Source

pub fn with_template_roots(self, roots: Vec<String>) -> Self

Attach the compiled template roots (see Self::template_roots).

Source

pub fn scripted(self, is_scripted: bool) -> Self

Mark whether this component has an authored client module.

Trait Implementations§

Source§

impl Clone for ComponentTemplateArtifact

Source§

fn clone(&self) -> ComponentTemplateArtifact

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 ComponentTemplateArtifact

Source§

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

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

impl Eq for ComponentTemplateArtifact

Source§

impl PartialEq for ComponentTemplateArtifact

Source§

fn eq(&self, other: &ComponentTemplateArtifact) -> 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 ComponentTemplateArtifact

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.