pub struct View<T> { /* private fields */ }Expand description
A wrapper for any kind of view.
Implementations§
Trait Implementations§
Source§impl<T> AddAnyAttr for View<T>where
T: AddAnyAttr,
impl<T> AddAnyAttr for View<T>where
T: AddAnyAttr,
Source§type Output<SomeNewAttr: Attribute> = View<<T as AddAnyAttr>::Output<SomeNewAttr>>
type Output<SomeNewAttr: Attribute> = View<<T as AddAnyAttr>::Output<SomeNewAttr>>
The new type once the attribute has been added.
Source§fn add_any_attr<NewAttr>(
self,
attr: NewAttr,
) -> <View<T> as AddAnyAttr>::Output<NewAttr>
fn add_any_attr<NewAttr>( self, attr: NewAttr, ) -> <View<T> as AddAnyAttr>::Output<NewAttr>
Adds an attribute to the view.
Source§impl<C> From<View<C>> for ViewFnOnce
impl<C> From<View<C>> for ViewFnOnce
Source§fn from(value: View<C>) -> ViewFnOnce
fn from(value: View<C>) -> ViewFnOnce
Converts to this type from the input type.
Source§impl<T> Ord for View<T>where
T: Ord,
impl<T> Ord for View<T>where
T: Ord,
Source§impl<T> PartialOrd for View<T>where
T: PartialOrd,
impl<T> PartialOrd for View<T>where
T: PartialOrd,
Source§impl<T> Render for View<T>where
T: Render,
impl<T> Render for View<T>where
T: Render,
Source§impl<T> RenderHtml for View<T>where
T: RenderHtml,
impl<T> RenderHtml for View<T>where
T: RenderHtml,
Source§const MIN_LENGTH: usize = <T as RenderHtml>::MIN_LENGTH
const MIN_LENGTH: usize = <T as RenderHtml>::MIN_LENGTH
The minimum length of HTML created when this view is rendered.
Source§const EXISTS: bool = <T as RenderHtml>::EXISTS
const EXISTS: bool = <T as RenderHtml>::EXISTS
Whether this should actually exist in the DOM, if it is the child of an element.
Source§type AsyncOutput = <T as RenderHtml>::AsyncOutput
type AsyncOutput = <T as RenderHtml>::AsyncOutput
The type of the view after waiting for all asynchronous data to load.
Source§async fn resolve(self) -> <View<T> as RenderHtml>::AsyncOutput
async fn resolve(self) -> <View<T> as RenderHtml>::AsyncOutput
Waits for any asynchronous sections of the view to load and returns the output.
Source§fn dry_resolve(&mut self)
fn dry_resolve(&mut self)
“Runs” the view without other side effects. For primitive types, this is a no-op. For
reactive types, this can be used to gather data about reactivity or about asynchronous data
that needs to be loaded.
Source§fn to_html_with_buf(
self,
buf: &mut String,
position: &mut Position,
escape: bool,
mark_branches: bool,
extra_attrs: Vec<AnyAttribute>,
)
fn to_html_with_buf( self, buf: &mut String, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
Renders a view to HTML, writing it into the given buffer.
Source§fn to_html_async_with_buf<const OUT_OF_ORDER: bool>(
self,
buf: &mut StreamBuilder,
position: &mut Position,
escape: bool,
mark_branches: bool,
extra_attrs: Vec<AnyAttribute>,
)
fn to_html_async_with_buf<const OUT_OF_ORDER: bool>( self, buf: &mut StreamBuilder, position: &mut Position, escape: bool, mark_branches: bool, extra_attrs: Vec<AnyAttribute>, )
Renders a view into a buffer of (synchronous or asynchronous) HTML chunks.
Source§fn hydrate<const FROM_SERVER: bool>(
self,
cursor: &Cursor,
position: &PositionState,
) -> <View<T> as Render>::State
fn hydrate<const FROM_SERVER: bool>( self, cursor: &Cursor, position: &PositionState, ) -> <View<T> as Render>::State
Makes a set of DOM nodes rendered from HTML interactive. Read more
Source§async fn hydrate_async(
self,
cursor: &Cursor,
position: &PositionState,
) -> <View<T> as Render>::State
async fn hydrate_async( self, cursor: &Cursor, position: &PositionState, ) -> <View<T> as Render>::State
Asynchronously makes a set of DOM nodes rendered from HTML interactive. Read more
Source§fn into_owned(self) -> <View<T> as RenderHtml>::Owned
fn into_owned(self) -> <View<T> as RenderHtml>::Owned
Convert into the equivalent value that is
'static.Source§fn html_len(&self) -> usize
fn html_len(&self) -> usize
An estimated length for this view, when rendered to HTML. Read more
Source§fn to_html_branching(self) -> Stringwhere
Self: Sized,
fn to_html_branching(self) -> Stringwhere
Self: Sized,
Renders a view to HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Source§fn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an in-order stream of HTML.
Source§fn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_in_order_branching(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an in-order stream of HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Source§fn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_out_of_order(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an out-of-order stream of HTML.
Source§fn to_html_stream_out_of_order_branching(self) -> StreamBuilderwhere
Self: Sized,
fn to_html_stream_out_of_order_branching(self) -> StreamBuilderwhere
Self: Sized,
Renders a view to an out-of-order stream of HTML with branch markers. This can be used to support libraries that diff
HTML pages against one another, by marking sections of the view that branch to different
types with marker comments.
Source§fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::Statewhere
Self: Sized,
fn hydrate_from<const FROM_SERVER: bool>(self, el: &Element) -> Self::Statewhere
Self: Sized,
Hydrates using
RenderHtml::hydrate, beginning at the given element.Source§fn hydrate_from_position<const FROM_SERVER: bool>(
self,
el: &Element,
position: Position,
) -> Self::Statewhere
Self: Sized,
fn hydrate_from_position<const FROM_SERVER: bool>(
self,
el: &Element,
position: Position,
) -> Self::Statewhere
Self: Sized,
Hydrates using
RenderHtml::hydrate, beginning at the given element and position.Source§impl<T> ToTemplate for View<T>where
T: ToTemplate,
impl<T> ToTemplate for View<T>where
T: ToTemplate,
Source§fn to_template(
buf: &mut String,
class: &mut String,
style: &mut String,
inner_html: &mut String,
position: &mut Position,
)
fn to_template( buf: &mut String, class: &mut String, style: &mut String, inner_html: &mut String, position: &mut Position, )
Renders a view type to a template. This does not take actual view data,
but can be used for constructing part of an HTML
<template> that corresponds
to a view of a particular type.impl<T> Eq for View<T>where
T: Eq,
impl<T> StructuralPartialEq for View<T>
Auto Trait Implementations§
impl<T> Freeze for View<T>where
T: Freeze,
impl<T> RefUnwindSafe for View<T>where
T: RefUnwindSafe,
impl<T> Send for View<T>where
T: Send,
impl<T> Sync for View<T>where
T: Sync,
impl<T> Unpin for View<T>where
T: Unpin,
impl<T> UnwindSafe for View<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for Vwhere
V: AddAnyAttr,
Key: AttributeKey,
Sig: IntoSplitSignal<Value = T>,
T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static,
Signal<BoolOrT<T>>: IntoProperty,
<Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static,
<Sig as IntoSplitSignal>::Write: Send + Clone + 'static,
Element: GetValue<T>,
impl<V, Key, Sig, T> BindAttribute<Key, Sig, T> for Vwhere
V: AddAnyAttr,
Key: AttributeKey,
Sig: IntoSplitSignal<Value = T>,
T: FromEventTarget + AttributeValue + PartialEq + Sync + 'static,
Signal<BoolOrT<T>>: IntoProperty,
<Sig as IntoSplitSignal>::Read: Get<Value = T> + Send + Sync + Clone + 'static,
<Sig as IntoSplitSignal>::Write: Send + Clone + 'static,
Element: GetValue<T>,
Source§type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>
type Output = <V as AddAnyAttr>::Output<Bind<Key, T, <Sig as IntoSplitSignal>::Read, <Sig as IntoSplitSignal>::Write>>
The type of the element with the two-way binding added.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T, K, V> CustomAttribute<K, V> for T
impl<T, K, V> CustomAttribute<K, V> for T
Source§fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>
fn attr(self, key: K, value: V) -> Self::Output<CustomAttr<K, V>>
Adds an HTML attribute by key and value.
Source§impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
impl<V, T, P, D> DirectiveAttribute<T, P, D> for V
Source§type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>
type Output = <V as AddAnyAttr>::Output<Directive<T, D, P>>
The type of the element with the directive added.
Source§fn directive(
self,
handler: D,
param: P,
) -> <V as DirectiveAttribute<T, P, D>>::Output
fn directive( self, handler: D, param: P, ) -> <V as DirectiveAttribute<T, P, D>>::Output
Adds a directive to the element, which runs some custom logic in the browser when the element
is created or hydrated.
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoAny for Twhere
T: Send + RenderHtml,
impl<T> IntoAny for Twhere
T: Send + RenderHtml,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoMaybeErased for Twhere
T: RenderHtml,
impl<T> IntoMaybeErased for Twhere
T: RenderHtml,
Source§fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output
fn into_maybe_erased(self) -> <T as IntoMaybeErased>::Output
Converts the view into a type-erased view if in erased mode.
Source§impl<T> IntoRender for Twhere
T: Render,
impl<T> IntoRender for Twhere
T: Render,
Source§fn into_render(self) -> <T as IntoRender>::Output
fn into_render(self) -> <T as IntoRender>::Output
Consumes this value, transforming it into the renderable type.
Source§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.