#[non_exhaustive]pub enum ViewPart {
Show 20 variants
Empty,
#[non_exhaustive] Bool(bool),
#[non_exhaustive] I8(i8),
#[non_exhaustive] I16(i16),
#[non_exhaustive] I32(i32),
#[non_exhaustive] I64(i64),
#[non_exhaustive] I128(i128),
#[non_exhaustive] Isize(isize),
#[non_exhaustive] U8(u8),
#[non_exhaustive] U16(u16),
#[non_exhaustive] U32(u32),
#[non_exhaustive] U64(u64),
#[non_exhaustive] U128(u128),
#[non_exhaustive] Usize(usize),
#[non_exhaustive] F32(f32),
#[non_exhaustive] F64(f64),
#[non_exhaustive] Char {
value: char,
context: HtmlContext,
},
#[non_exhaustive] Str {
value: Cow<'static, str>,
context: HtmlContext,
},
#[non_exhaustive] BoxDyn {
inner: Box<dyn DynViewPart>,
context: HtmlContext,
size_hint: usize,
},
#[non_exhaustive] BoxSlice {
inner: Box<[ViewPart]>,
size_hint: usize,
},
}Expand description
A renderable value stored in a View.
View parts are created through a PartsWriter or the view! macro. A
part that holds text also records the HtmlContext it was written for,
so rendering escapes or validates it for exactly that position.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Empty
Renders no content.
#[non_exhaustive]Bool(bool)
A boolean rendered as text.
#[non_exhaustive]I8(i8)
An i8 rendered as text.
#[non_exhaustive]I16(i16)
An i16 rendered as text.
#[non_exhaustive]I32(i32)
An i32 rendered as text.
#[non_exhaustive]I64(i64)
An i64 rendered as text.
#[non_exhaustive]I128(i128)
An i128 rendered as text.
#[non_exhaustive]Isize(isize)
An isize rendered as text.
#[non_exhaustive]U8(u8)
A u8 rendered as text.
#[non_exhaustive]U16(u16)
A u16 rendered as text.
#[non_exhaustive]U32(u32)
A u32 rendered as text.
#[non_exhaustive]U64(u64)
A u64 rendered as text.
#[non_exhaustive]U128(u128)
A u128 rendered as text.
#[non_exhaustive]Usize(usize)
A usize rendered as text.
#[non_exhaustive]F32(f32)
An f32 rendered as text.
#[non_exhaustive]F64(f64)
An f64 rendered as text.
#[non_exhaustive]Char
A character rendered for the recorded context.
Fields
This variant is marked as non-exhaustive
context: HtmlContext#[non_exhaustive]Str
A string rendered for the recorded context.
Fields
This variant is marked as non-exhaustive
context: HtmlContext#[non_exhaustive]BoxDyn
A custom view part that writes its output at render time.
Fields
This variant is marked as non-exhaustive
inner: Box<dyn DynViewPart>context: HtmlContext#[non_exhaustive]BoxSlice
A sequence of view parts rendered in order.
Implementations§
Trait Implementations§
Source§impl AttributeValueViewParts for ViewPart
impl AttributeValueViewParts for ViewPart
Source§fn attribute_present(&self) -> bool
fn attribute_present(&self) -> bool
Source§fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
Source§impl AttributeViewParts for ViewPart
impl AttributeViewParts for ViewPart
Source§fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
Source§impl ClassViewParts for ViewPart
An attribute value, such as one taken from an
Attributes collection with
get, spliced in as a single entry.
impl ClassViewParts for ViewPart
An attribute value, such as one taken from an
Attributes collection with
get, spliced in as a single entry.
Source§fn is_present(&self) -> bool
fn is_present(&self) -> bool
Source§fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
fn into_view_parts(self, _cx: &Cx, parts: &mut PartsWriter<'_>)
Source§impl ClassViewParts for &ViewPart
impl ClassViewParts for &ViewPart
Source§fn is_present(&self) -> bool
fn is_present(&self) -> bool
Source§fn into_view_parts(self, cx: &Cx, parts: &mut PartsWriter<'_>)
fn into_view_parts(self, cx: &Cx, parts: &mut PartsWriter<'_>)
Auto Trait Implementations§
impl !RefUnwindSafe for ViewPart
impl !Sync for ViewPart
impl !UnwindSafe for ViewPart
impl Freeze for ViewPart
impl Send for ViewPart
impl Unpin for ViewPart
impl UnsafeUnpin for ViewPart
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
Source§impl<T> ClassEntries for Twhere
T: ClassViewParts,
impl<T> ClassEntries for Twhere
T: ClassViewParts,
Source§fn any_present(&self) -> bool
fn any_present(&self) -> bool
Source§fn write_entries(self, cx: &Cx, writer: &mut ClassWriter<'_, '_>)
fn write_entries(self, cx: &Cx, writer: &mut ClassWriter<'_, '_>)
writer.