Skip to main content

WebUiFragment

Struct WebUiFragment 

Source
pub struct WebUiFragment {
    pub fragment: Option<Fragment>,
}
Expand description

A single fragment — one of several types.

Fields§

§fragment: Option<Fragment>

Implementations§

Source§

impl WebUiFragment

Source

pub fn raw(value: impl Into<String>) -> Self

Create a raw (static content) fragment.

Source

pub fn component(fragment_id: impl Into<String>) -> Self

Create a component fragment.

Source

pub fn for_loop( item: impl Into<String>, collection: impl Into<String>, fragment_id: impl Into<String>, ) -> Self

Create a for-loop fragment.

Source

pub fn signal(value: impl Into<String>, raw: bool) -> Self

Create a signal fragment.

Source

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. &amp;) 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.

Source

pub fn if_cond(condition: ConditionExpr, fragment_id: impl Into<String>) -> Self

Create an if-condition fragment.

Source

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.

Source

pub fn boundary_end(declaration_id: u32) -> Self

Create the end marker that closes an inline streaming boundary tape.

Source

pub fn attribute(name: impl Into<String>, value: impl Into<String>) -> Self

Create a simple dynamic attribute fragment (value is a single signal name).

Source

pub fn attribute_template( name: impl Into<String>, template: impl Into<String>, ) -> Self

Create a template attribute fragment (mixed static + dynamic content).

Source

pub fn attribute_complex( name: impl Into<String>, value: impl Into<String>, ) -> Self

Create a complex attribute fragment (:-prefixed).

Source

pub fn attribute_boolean( name: impl Into<String>, condition_tree: ConditionExpr, ) -> Self

Create a boolean attribute fragment (?-prefixed) with a condition tree.

Source

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.

Source

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.

Source

pub fn route_from(route: WebUiFragmentRoute) -> Self

Create a route fragment from a pre-built WebUiFragmentRoute.

Source

pub fn outlet() -> Self

Create an outlet fragment.

Trait Implementations§

Source§

impl Clone for WebUiFragment

Source§

fn clone(&self) -> WebUiFragment

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 WebUiFragment

Source§

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

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

impl Default for WebUiFragment

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for WebUiFragment

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 Message for WebUiFragment

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 WebUiFragment

Source§

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

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 WebUiFragment

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, <T as TryFrom<U>>::Error>

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.