pub struct WebUiFragment {
pub fragment: Option<Fragment>,
}Expand description
A single fragment — one of several types.
Fields§
§fragment: Option<Fragment>Implementations§
Source§impl WebUiFragment
impl WebUiFragment
Sourcepub fn for_loop(
item: impl Into<String>,
collection: impl Into<String>,
fragment_id: impl Into<String>,
) -> Self
pub fn for_loop( item: impl Into<String>, collection: impl Into<String>, fragment_id: impl Into<String>, ) -> Self
Create a for-loop fragment.
Sourcepub fn raw_text_signal(value: impl Into<String>, raw: bool) -> Self
pub fn raw_text_signal(value: impl Into<String>, raw: bool) -> Self
Create a signal inside an HTML raw-text context such as <style>.
raw_text_context is scoped to marker ownership only: it tells the
handler that comment/text sibling markers cannot be inserted around this
signal because they would be inert plain text in a raw-text/RCDATA
element (<script>, <style>, <xmp>, <title>, <textarea>, …).
It does not change escaping. The rendered value still follows plain
raw semantics: raw = false ({{value}}) HTML-encodes the value via
encode_safe, raw = true ({{{value}}}) writes it verbatim.
This distinction matters because HTML raw-text elements (<script>,
<style>, <xmp>, <iframe>, <noembed>, <noframes>) never decode
character references, unlike RCDATA elements (<title>, <textarea>)
which do. Authors who bind a value that may contain &, <, >, or
quotes inside a raw-text element must use the raw ({{{value}}}) form;
otherwise the HTML-encoded entities (e.g. &) are emitted as literal
text and are never decoded back by the browser, corrupting the CSS/JS.
The parser does not currently reject an escaped binding in these
contexts — this is a known authoring footgun, not a parser bug.
Sourcepub fn if_cond(condition: ConditionExpr, fragment_id: impl Into<String>) -> Self
pub fn if_cond(condition: ConditionExpr, fragment_id: impl Into<String>) -> Self
Create an if-condition fragment.
Sourcepub fn boundary(
declaration_id: u32,
owner_fragment_id: impl Into<String>,
name: impl Into<String>,
key: Option<String>,
) -> Self
pub fn boundary( declaration_id: u32, owner_fragment_id: impl Into<String>, name: impl Into<String>, key: Option<String>, ) -> Self
Create the start marker of an inline streaming boundary tape.
The body fragments follow this marker in the same record and are closed
by Self::boundary_end carrying the same declaration_id.
Sourcepub fn boundary_end(declaration_id: u32) -> Self
pub fn boundary_end(declaration_id: u32) -> Self
Create the end marker that closes an inline streaming boundary tape.
Sourcepub fn attribute(name: impl Into<String>, value: impl Into<String>) -> Self
pub fn attribute(name: impl Into<String>, value: impl Into<String>) -> Self
Create a simple dynamic attribute fragment (value is a single signal name).
Sourcepub fn attribute_template(
name: impl Into<String>,
template: impl Into<String>,
) -> Self
pub fn attribute_template( name: impl Into<String>, template: impl Into<String>, ) -> Self
Create a template attribute fragment (mixed static + dynamic content).
Sourcepub fn attribute_complex(
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn attribute_complex( name: impl Into<String>, value: impl Into<String>, ) -> Self
Create a complex attribute fragment (:-prefixed).
Sourcepub fn attribute_boolean(
name: impl Into<String>,
condition_tree: ConditionExpr,
) -> Self
pub fn attribute_boolean( name: impl Into<String>, condition_tree: ConditionExpr, ) -> Self
Create a boolean attribute fragment (?-prefixed) with a condition tree.
Sourcepub fn plugin(data: Vec<u8>) -> Self
pub fn plugin(data: Vec<u8>) -> Self
Create a plugin data fragment with opaque bytes. The data is passed through to the handler plugin without interpretation.
Sourcepub fn route(path: impl Into<String>, fragment_id: impl Into<String>) -> Self
pub fn route(path: impl Into<String>, fragment_id: impl Into<String>) -> Self
Create a route fragment linking a URL path template to a fragment.
Sourcepub fn route_from(route: WebUiFragmentRoute) -> Self
pub fn route_from(route: WebUiFragmentRoute) -> Self
Create a route fragment from a pre-built WebUiFragmentRoute.
Trait Implementations§
Source§impl Clone for WebUiFragment
impl Clone for WebUiFragment
Source§impl Debug for WebUiFragment
impl Debug for WebUiFragment
Source§impl Default for WebUiFragment
impl Default for WebUiFragment
Source§impl<'de> Deserialize<'de> for WebUiFragment
impl<'de> Deserialize<'de> for WebUiFragment
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 WebUiFragment
impl Message for WebUiFragment
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.