pub struct WebUiProtocol {
pub fragments: HashMap<String, FragmentList>,
pub tokens: Vec<String>,
pub components: HashMap<String, ComponentData>,
}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).
Implementations§
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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for WebUiProtocol
impl Message for WebUiProtocol
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
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,
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
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,
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,
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,
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,
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,
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 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,
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.Source§impl PartialEq for WebUiProtocol
impl PartialEq for WebUiProtocol
Source§impl Serialize for WebUiProtocol
impl Serialize for WebUiProtocol
impl StructuralPartialEq for WebUiProtocol
Auto Trait Implementations§
impl Freeze for WebUiProtocol
impl RefUnwindSafe for WebUiProtocol
impl Send for WebUiProtocol
impl Sync for WebUiProtocol
impl Unpin for WebUiProtocol
impl UnsafeUnpin for WebUiProtocol
impl UnwindSafe for WebUiProtocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more