Skip to main content

ComponentData

Struct ComponentData 

Source
pub struct ComponentData {
    pub template: String,
    pub css: String,
    pub css_href: String,
    pub template_json: String,
    pub template_functions: String,
    pub hydration_keys: Vec<String>,
    pub navigation_keys: Vec<String>,
    pub hydration_mode: i32,
    pub navigation_mode: Option<i32>,
    pub uses_shadow_dom: bool,
    pub work_policy: i32,
}
Expand description

Per-component metadata keyed by tag name.

Fields§

§template: String

Non-WebUI client-side template payload. FAST plugins store complete HTML here.

§css: String

Compiled component CSS content for the Style and Module strategies. Empty for Link and for components without CSS.

§css_href: String

External stylesheet href for the Link CSS strategy. Set to e.g. “/my-card.css” when the component has a CSS file and the build used CssStrategy::Link. Empty for Style/Module strategies and for components without CSS. Ordered style closures decide which Document or ShadowRoot owns the link.

§template_json: String

WebUI plugin JSON-safe component metadata. Stored separately from executable condition closures so handlers can emit the static metadata in application/json data blocks.

§template_functions: String

WebUI plugin component-local JavaScript condition closure array. Empty when the component has no conditions or boolean attributes.

§hydration_keys: Vec<String>

Exact @observable + @attr property keys when hydration_mode is KEYS. Existing SSR host attributes take precedence; bootstrap state fills attribute-backed properties that were not materialized on the host. Template roots already exist in the trusted SSR DOM and do not enter initial state solely because a component has authored browser code. Sorted and deduplicated; empty for NONE and ALL.

§navigation_keys: Vec<String>

Exact partial-navigation keys when navigation_mode is KEYS. Authored components use @observable + @attr property keys plus template roots. Scriptless compiled templates include only their template roots. Sorted and deduplicated; empty for NONE and ALL.

§hydration_mode: i32

How initial hydration state is selected for this component.

§navigation_mode: Option<i32>

How partial-navigation state is selected for this component. Presence is significant: protocols produced before projection metadata leave this absent, so handlers preserve full state instead of treating it as NONE.

§uses_shadow_dom: bool

Whether this component effectively uses Shadow DOM after build-time fallback and authored declarative Shadow DOM resolution.

§work_policy: i32

Compiler-owned client work policy. Zero/eager is absent on the wire.

Implementations§

Source§

impl ComponentData

Source

pub fn hydration_mode(&self) -> StateProjectionMode

Returns the enum value of hydration_mode, or the default if the field is set to an invalid enum value.

Source

pub fn set_hydration_mode(&mut self, value: StateProjectionMode)

Sets hydration_mode to the provided enum value.

Source

pub fn navigation_mode(&self) -> StateProjectionMode

Returns the enum value of navigation_mode, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_navigation_mode(&mut self, value: StateProjectionMode)

Sets navigation_mode to the provided enum value.

Source

pub fn work_policy(&self) -> ComponentWorkPolicy

Returns the enum value of work_policy, or the default if the field is set to an invalid enum value.

Source

pub fn set_work_policy(&mut self, value: ComponentWorkPolicy)

Sets work_policy to the provided enum value.

Trait Implementations§

Source§

impl Clone for ComponentData

Source§

fn clone(&self) -> ComponentData

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 ComponentData

Source§

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

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

impl Default for ComponentData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ComponentData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ComponentData

Source§

impl Hash for ComponentData

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for ComponentData

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘ
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for ComponentData

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for ComponentData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ComponentData

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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