pub struct WebUiProtocol {
pub fragments: HashMap<String, FragmentList>,
pub tokens: Vec<String>,
pub components: HashMap<String, ComponentData>,
pub css_strategy: i32,
pub dom_strategy: i32,
pub initial_state_strategy: i32,
pub module_preloads: Vec<String>,
pub streaming_boundaries: HashMap<String, StreamingBoundaryList>,
pub component_render_css: String,
}Expand description
Root protocol containing all fragment records and build metadata.
Fields§
§fragments: HashMap<String, FragmentList>§tokens: Vec<String>Sorted, deduplicated CSS custom property names used across all components and entry page styles (e.g., “colorBrandBackground”, “spacingMedium”). Only usage via var(–name) is included; local definitions are excluded.
components: HashMap<String, ComponentData>Per-component data keyed by tag name (f-template + CSS).
css_strategy: i32Build-wide CSS delivery strategy. Determines how the handler emits CSS-related tags in
for components with css_href.dom_strategy: i32Build-wide DOM encapsulation strategy. Combined with css_strategy to decide preload vs stylesheet emission.
initial_state_strategy: i32Whether initial SSR metadata contains full state or WebUI component projection. Partial-navigation state remains component-driven.
module_preloads: Vec<String>Ready-to-write <link rel="modulepreload"> hrefs for the shared chunks
that the page’s critical module entries statically import, in the exact
order they must be emitted (largest chunk first).
These chunks are named only inside the entry’s own bytes, so the browser’s preload scanner cannot discover them until it has downloaded and parsed the entry. Emitting them as hints removes that serialization.
Order is load-bearing: preloads are issued in document order over one connection, so a small chunk ahead of a large one delays the long pole. The compiler resolves and sorts these at build time so the handler writes them verbatim with no per-request work.
streaming_boundaries: HashMap<String, StreamingBoundaryList>Free-form
component_render_css: StringBuild-generated document-level rules for component rendering policies. Empty when no component opts into lazy rendering.
Implementations§
Source§impl WebUiProtocol
impl WebUiProtocol
Sourcepub fn css_strategy(&self) -> CssStrategy
pub fn css_strategy(&self) -> CssStrategy
Returns the enum value of css_strategy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_css_strategy(&mut self, value: CssStrategy)
pub fn set_css_strategy(&mut self, value: CssStrategy)
Sets css_strategy to the provided enum value.
Sourcepub fn dom_strategy(&self) -> DomStrategy
pub fn dom_strategy(&self) -> DomStrategy
Returns the enum value of dom_strategy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_dom_strategy(&mut self, value: DomStrategy)
pub fn set_dom_strategy(&mut self, value: DomStrategy)
Sets dom_strategy to the provided enum value.
Sourcepub fn initial_state_strategy(&self) -> InitialStateStrategy
pub fn initial_state_strategy(&self) -> InitialStateStrategy
Returns the enum value of initial_state_strategy, or the default if the field is set to an invalid enum value.
Sourcepub fn set_initial_state_strategy(&mut self, value: InitialStateStrategy)
pub fn set_initial_state_strategy(&mut self, value: InitialStateStrategy)
Sets initial_state_strategy to the provided enum value.
Source§impl WebUiProtocol
impl WebUiProtocol
Sourcepub fn new(fragments: WebUIFragmentRecords) -> Self
pub fn new(fragments: WebUIFragmentRecords) -> Self
Create a protocol from fragment records with no CSS tokens.
Sourcepub fn with_tokens(fragments: WebUIFragmentRecords, tokens: Vec<String>) -> Self
pub fn with_tokens(fragments: WebUIFragmentRecords, tokens: Vec<String>) -> Self
Create a protocol from fragment records with CSS tokens.
Source§impl WebUiProtocol
impl WebUiProtocol
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serialize protocol to pretty JSON (for debug/inspect output only).
Sourcepub fn to_protobuf(&self) -> Result<Vec<u8>>
pub fn to_protobuf(&self) -> Result<Vec<u8>>
Serialize protocol to protobuf binary format.
Sourcepub fn from_protobuf(bytes: &[u8]) -> Result<Self>
pub fn from_protobuf(bytes: &[u8]) -> Result<Self>
Deserialize protocol from protobuf binary bytes with validation.
Sourcepub fn from_protobuf_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_protobuf_file<P: AsRef<Path>>(path: P) -> Result<Self>
Read and deserialize a protobuf file with validation.
Trait Implementations§
Source§impl Clone for WebUiProtocol
impl Clone for WebUiProtocol
Source§fn clone(&self) -> WebUiProtocol
fn clone(&self) -> WebUiProtocol
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebUiProtocol
impl Debug for WebUiProtocol
Source§impl Default for WebUiProtocol
impl Default for WebUiProtocol
Source§impl<'de> Deserialize<'de> for WebUiProtocol
impl<'de> Deserialize<'de> for WebUiProtocol
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Message for WebUiProtocol
impl Message for WebUiProtocol
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.