pub struct View<T = HtmlNode> { /* private fields */ }
Expand description
Represents a view tree.
Internally, this stores a list of nodes. This is the main type that is returned from components.
Implementations§
Source§impl<T> View<T>
impl<T> View<T>
Sourcepub fn from_nodes(nodes: Vec<T>) -> Self
pub fn from_nodes(nodes: Vec<T>) -> Self
Create a new view with multiple nodes.
Sourcepub fn from_dynamic<U: Into<Self> + 'static>(
f: impl FnMut() -> U + 'static,
) -> Selfwhere
T: ViewNode,
pub fn from_dynamic<U: Into<Self> + 'static>(
f: impl FnMut() -> U + 'static,
) -> Selfwhere
T: ViewNode,
Create a new view from a function that returns a view. An alias to
ViewNode::create_dynamic_view
.
Sourcepub fn as_web_sys(&self) -> Vec<Node>where
T: ViewHtmlNode,
pub fn as_web_sys(&self) -> Vec<Node>where
T: ViewHtmlNode,
Create a flat list of all the web-sys nodes in the view.
Trait Implementations§
Source§impl<U, A, B, C, D> From<(A, B, C, D)> for View<U>
impl<U, A, B, C, D> From<(A, B, C, D)> for View<U>
Source§fn from(t: (A, B, C, D)) -> Self
fn from(t: (A, B, C, D)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E> From<(A, B, C, D, E)> for View<U>
impl<U, A, B, C, D, E> From<(A, B, C, D, E)> for View<U>
Source§fn from(t: (A, B, C, D, E)) -> Self
fn from(t: (A, B, C, D, E)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E, F> From<(A, B, C, D, E, F)> for View<U>
impl<U, A, B, C, D, E, F> From<(A, B, C, D, E, F)> for View<U>
Source§fn from(t: (A, B, C, D, E, F)) -> Self
fn from(t: (A, B, C, D, E, F)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E, F, G> From<(A, B, C, D, E, F, G)> for View<U>
impl<U, A, B, C, D, E, F, G> From<(A, B, C, D, E, F, G)> for View<U>
Source§fn from(t: (A, B, C, D, E, F, G)) -> Self
fn from(t: (A, B, C, D, E, F, G)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E, F, G, H> From<(A, B, C, D, E, F, G, H)> for View<U>
impl<U, A, B, C, D, E, F, G, H> From<(A, B, C, D, E, F, G, H)> for View<U>
Source§fn from(t: (A, B, C, D, E, F, G, H)) -> Self
fn from(t: (A, B, C, D, E, F, G, H)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E, F, G, H, I> From<(A, B, C, D, E, F, G, H, I)> for View<U>
impl<U, A, B, C, D, E, F, G, H, I> From<(A, B, C, D, E, F, G, H, I)> for View<U>
Source§fn from(t: (A, B, C, D, E, F, G, H, I)) -> Self
fn from(t: (A, B, C, D, E, F, G, H, I)) -> Self
Converts to this type from the input type.
Source§impl<U, A, B, C, D, E, F, G, H, I, J> From<(A, B, C, D, E, F, G, H, I, J)> for View<U>
impl<U, A, B, C, D, E, F, G, H, I, J> From<(A, B, C, D, E, F, G, H, I, J)> for View<U>
Source§fn from(t: (A, B, C, D, E, F, G, H, I, J)) -> Self
fn from(t: (A, B, C, D, E, F, G, H, I, J)) -> Self
Converts to this type from the input type.
Source§impl From<CustomElement> for View
impl From<CustomElement> for View
Source§fn from(el: CustomElement) -> Self
fn from(el: CustomElement) -> Self
Converts to this type from the input type.
Source§impl<T: ViewNode, F: FnMut() -> U + 'static, U: Into<View<T>> + Any + 'static> From<F> for View<T>
impl<T: ViewNode, F: FnMut() -> U + 'static, U: Into<View<T>> + Any + 'static> From<F> for View<T>
Source§impl From<HtmlAddress> for View
impl From<HtmlAddress> for View
Source§fn from(el: HtmlAddress) -> Self
fn from(el: HtmlAddress) -> Self
Converts to this type from the input type.
Source§impl From<HtmlArticle> for View
impl From<HtmlArticle> for View
Source§fn from(el: HtmlArticle) -> Self
fn from(el: HtmlArticle) -> Self
Converts to this type from the input type.
Source§impl From<HtmlBlockquote> for View
impl From<HtmlBlockquote> for View
Source§fn from(el: HtmlBlockquote) -> Self
fn from(el: HtmlBlockquote) -> Self
Converts to this type from the input type.
Source§impl From<HtmlButton> for View
impl From<HtmlButton> for View
Source§fn from(el: HtmlButton) -> Self
fn from(el: HtmlButton) -> Self
Converts to this type from the input type.
Source§impl From<HtmlCanvas> for View
impl From<HtmlCanvas> for View
Source§fn from(el: HtmlCanvas) -> Self
fn from(el: HtmlCanvas) -> Self
Converts to this type from the input type.
Source§impl From<HtmlCaption> for View
impl From<HtmlCaption> for View
Source§fn from(el: HtmlCaption) -> Self
fn from(el: HtmlCaption) -> Self
Converts to this type from the input type.
Source§impl From<HtmlColgroup> for View
impl From<HtmlColgroup> for View
Source§fn from(el: HtmlColgroup) -> Self
fn from(el: HtmlColgroup) -> Self
Converts to this type from the input type.
Source§impl From<HtmlDatalist> for View
impl From<HtmlDatalist> for View
Source§fn from(el: HtmlDatalist) -> Self
fn from(el: HtmlDatalist) -> Self
Converts to this type from the input type.
Source§impl From<HtmlDetails> for View
impl From<HtmlDetails> for View
Source§fn from(el: HtmlDetails) -> Self
fn from(el: HtmlDetails) -> Self
Converts to this type from the input type.
Source§impl From<HtmlDialog> for View
impl From<HtmlDialog> for View
Source§fn from(el: HtmlDialog) -> Self
fn from(el: HtmlDialog) -> Self
Converts to this type from the input type.
Source§impl From<HtmlFieldset> for View
impl From<HtmlFieldset> for View
Source§fn from(el: HtmlFieldset) -> Self
fn from(el: HtmlFieldset) -> Self
Converts to this type from the input type.
Source§impl From<HtmlFigcaption> for View
impl From<HtmlFigcaption> for View
Source§fn from(el: HtmlFigcaption) -> Self
fn from(el: HtmlFigcaption) -> Self
Converts to this type from the input type.
Source§impl From<HtmlFigure> for View
impl From<HtmlFigure> for View
Source§fn from(el: HtmlFigure) -> Self
fn from(el: HtmlFigure) -> Self
Converts to this type from the input type.
Source§fn from(el: HtmlFooter) -> Self
fn from(el: HtmlFooter) -> Self
Converts to this type from the input type.
Source§impl From<HtmlHeader> for View
impl From<HtmlHeader> for View
Source§fn from(el: HtmlHeader) -> Self
fn from(el: HtmlHeader) -> Self
Converts to this type from the input type.
Source§impl From<HtmlHgroup> for View
impl From<HtmlHgroup> for View
Source§fn from(el: HtmlHgroup) -> Self
fn from(el: HtmlHgroup) -> Self
Converts to this type from the input type.
Source§impl From<HtmlIframe> for View
impl From<HtmlIframe> for View
Source§fn from(el: HtmlIframe) -> Self
fn from(el: HtmlIframe) -> Self
Converts to this type from the input type.
Source§impl From<HtmlKeygen> for View
impl From<HtmlKeygen> for View
Source§fn from(el: HtmlKeygen) -> Self
fn from(el: HtmlKeygen) -> Self
Converts to this type from the input type.
Source§impl From<HtmlLegend> for View
impl From<HtmlLegend> for View
Source§fn from(el: HtmlLegend) -> Self
fn from(el: HtmlLegend) -> Self
Converts to this type from the input type.
Source§impl From<HtmlMenuitem> for View
impl From<HtmlMenuitem> for View
Source§fn from(el: HtmlMenuitem) -> Self
fn from(el: HtmlMenuitem) -> Self
Converts to this type from the input type.
Source§impl From<HtmlNoscript> for View
impl From<HtmlNoscript> for View
Source§fn from(el: HtmlNoscript) -> Self
fn from(el: HtmlNoscript) -> Self
Converts to this type from the input type.
Source§impl From<HtmlObject> for View
impl From<HtmlObject> for View
Source§fn from(el: HtmlObject) -> Self
fn from(el: HtmlObject) -> Self
Converts to this type from the input type.
Source§impl From<HtmlOptgroup> for View
impl From<HtmlOptgroup> for View
Source§fn from(el: HtmlOptgroup) -> Self
fn from(el: HtmlOptgroup) -> Self
Converts to this type from the input type.
Source§impl From<HtmlOption> for View
impl From<HtmlOption> for View
Source§fn from(el: HtmlOption) -> Self
fn from(el: HtmlOption) -> Self
Converts to this type from the input type.
Source§impl From<HtmlOutput> for View
impl From<HtmlOutput> for View
Source§fn from(el: HtmlOutput) -> Self
fn from(el: HtmlOutput) -> Self
Converts to this type from the input type.
Source§impl From<HtmlPicture> for View
impl From<HtmlPicture> for View
Source§fn from(el: HtmlPicture) -> Self
fn from(el: HtmlPicture) -> Self
Converts to this type from the input type.
Source§impl From<HtmlProgress> for View
impl From<HtmlProgress> for View
Source§fn from(el: HtmlProgress) -> Self
fn from(el: HtmlProgress) -> Self
Converts to this type from the input type.
Source§impl From<HtmlScript> for View
impl From<HtmlScript> for View
Source§fn from(el: HtmlScript) -> Self
fn from(el: HtmlScript) -> Self
Converts to this type from the input type.
Source§impl From<HtmlSection> for View
impl From<HtmlSection> for View
Source§fn from(el: HtmlSection) -> Self
fn from(el: HtmlSection) -> Self
Converts to this type from the input type.
Source§impl From<HtmlSelect> for View
impl From<HtmlSelect> for View
Source§fn from(el: HtmlSelect) -> Self
fn from(el: HtmlSelect) -> Self
Converts to this type from the input type.
Source§impl From<HtmlSource> for View
impl From<HtmlSource> for View
Source§fn from(el: HtmlSource) -> Self
fn from(el: HtmlSource) -> Self
Converts to this type from the input type.
Source§impl From<HtmlStrong> for View
impl From<HtmlStrong> for View
Source§fn from(el: HtmlStrong) -> Self
fn from(el: HtmlStrong) -> Self
Converts to this type from the input type.
Source§impl From<HtmlSummary> for View
impl From<HtmlSummary> for View
Source§fn from(el: HtmlSummary) -> Self
fn from(el: HtmlSummary) -> Self
Converts to this type from the input type.
Source§impl From<HtmlTemplate> for View
impl From<HtmlTemplate> for View
Source§fn from(el: HtmlTemplate) -> Self
fn from(el: HtmlTemplate) -> Self
Converts to this type from the input type.
Source§impl From<HtmlTextarea> for View
impl From<HtmlTextarea> for View
Source§fn from(el: HtmlTextarea) -> Self
fn from(el: HtmlTextarea) -> Self
Converts to this type from the input type.
Source§impl From<SvgAnimate> for View
impl From<SvgAnimate> for View
Source§fn from(el: SvgAnimate) -> Self
fn from(el: SvgAnimate) -> Self
Converts to this type from the input type.
Source§impl From<SvgAnimateMotion> for View
impl From<SvgAnimateMotion> for View
Source§fn from(el: SvgAnimateMotion) -> Self
fn from(el: SvgAnimateMotion) -> Self
Converts to this type from the input type.
Source§impl From<SvgAnimateTransform> for View
impl From<SvgAnimateTransform> for View
Source§fn from(el: SvgAnimateTransform) -> Self
fn from(el: SvgAnimateTransform) -> Self
Converts to this type from the input type.
Source§impl From<SvgClipPath> for View
impl From<SvgClipPath> for View
Source§fn from(el: SvgClipPath) -> Self
fn from(el: SvgClipPath) -> Self
Converts to this type from the input type.
Source§impl From<SvgDiscard> for View
impl From<SvgDiscard> for View
Source§fn from(el: SvgDiscard) -> Self
fn from(el: SvgDiscard) -> Self
Converts to this type from the input type.
Source§impl From<SvgEllipse> for View
impl From<SvgEllipse> for View
Source§fn from(el: SvgEllipse) -> Self
fn from(el: SvgEllipse) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeBlend> for View
impl From<SvgFeBlend> for View
Source§fn from(el: SvgFeBlend) -> Self
fn from(el: SvgFeBlend) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeColorMatrix> for View
impl From<SvgFeColorMatrix> for View
Source§fn from(el: SvgFeColorMatrix) -> Self
fn from(el: SvgFeColorMatrix) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeComponentTransfer> for View
impl From<SvgFeComponentTransfer> for View
Source§fn from(el: SvgFeComponentTransfer) -> Self
fn from(el: SvgFeComponentTransfer) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeComposite> for View
impl From<SvgFeComposite> for View
Source§fn from(el: SvgFeComposite) -> Self
fn from(el: SvgFeComposite) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeConvolveMatrix> for View
impl From<SvgFeConvolveMatrix> for View
Source§fn from(el: SvgFeConvolveMatrix) -> Self
fn from(el: SvgFeConvolveMatrix) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeDiffuseLighting> for View
impl From<SvgFeDiffuseLighting> for View
Source§fn from(el: SvgFeDiffuseLighting) -> Self
fn from(el: SvgFeDiffuseLighting) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeDisplacementMap> for View
impl From<SvgFeDisplacementMap> for View
Source§fn from(el: SvgFeDisplacementMap) -> Self
fn from(el: SvgFeDisplacementMap) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeDistantLight> for View
impl From<SvgFeDistantLight> for View
Source§fn from(el: SvgFeDistantLight) -> Self
fn from(el: SvgFeDistantLight) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeDropShadow> for View
impl From<SvgFeDropShadow> for View
Source§fn from(el: SvgFeDropShadow) -> Self
fn from(el: SvgFeDropShadow) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeFlood> for View
impl From<SvgFeFlood> for View
Source§fn from(el: SvgFeFlood) -> Self
fn from(el: SvgFeFlood) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeFuncA> for View
impl From<SvgFeFuncA> for View
Source§fn from(el: SvgFeFuncA) -> Self
fn from(el: SvgFeFuncA) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeFuncB> for View
impl From<SvgFeFuncB> for View
Source§fn from(el: SvgFeFuncB) -> Self
fn from(el: SvgFeFuncB) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeFuncG> for View
impl From<SvgFeFuncG> for View
Source§fn from(el: SvgFeFuncG) -> Self
fn from(el: SvgFeFuncG) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeFuncR> for View
impl From<SvgFeFuncR> for View
Source§fn from(el: SvgFeFuncR) -> Self
fn from(el: SvgFeFuncR) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeGaussianBlur> for View
impl From<SvgFeGaussianBlur> for View
Source§fn from(el: SvgFeGaussianBlur) -> Self
fn from(el: SvgFeGaussianBlur) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeImage> for View
impl From<SvgFeImage> for View
Source§fn from(el: SvgFeImage) -> Self
fn from(el: SvgFeImage) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeMerge> for View
impl From<SvgFeMerge> for View
Source§fn from(el: SvgFeMerge) -> Self
fn from(el: SvgFeMerge) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeMergeNode> for View
impl From<SvgFeMergeNode> for View
Source§fn from(el: SvgFeMergeNode) -> Self
fn from(el: SvgFeMergeNode) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeMorphology> for View
impl From<SvgFeMorphology> for View
Source§fn from(el: SvgFeMorphology) -> Self
fn from(el: SvgFeMorphology) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeOffset> for View
impl From<SvgFeOffset> for View
Source§fn from(el: SvgFeOffset) -> Self
fn from(el: SvgFeOffset) -> Self
Converts to this type from the input type.
Source§impl From<SvgFePointLight> for View
impl From<SvgFePointLight> for View
Source§fn from(el: SvgFePointLight) -> Self
fn from(el: SvgFePointLight) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeSpecularLighting> for View
impl From<SvgFeSpecularLighting> for View
Source§fn from(el: SvgFeSpecularLighting) -> Self
fn from(el: SvgFeSpecularLighting) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeSpotLight> for View
impl From<SvgFeSpotLight> for View
Source§fn from(el: SvgFeSpotLight) -> Self
fn from(el: SvgFeSpotLight) -> Self
Converts to this type from the input type.
Source§impl From<SvgFeTurbulence> for View
impl From<SvgFeTurbulence> for View
Source§fn from(el: SvgFeTurbulence) -> Self
fn from(el: SvgFeTurbulence) -> Self
Converts to this type from the input type.
Source§impl From<SvgForeignObject> for View
impl From<SvgForeignObject> for View
Source§fn from(el: SvgForeignObject) -> Self
fn from(el: SvgForeignObject) -> Self
Converts to this type from the input type.
Source§impl From<SvgHatchpath> for View
impl From<SvgHatchpath> for View
Source§fn from(el: SvgHatchpath) -> Self
fn from(el: SvgHatchpath) -> Self
Converts to this type from the input type.
Source§impl From<SvgLinearGradient> for View
impl From<SvgLinearGradient> for View
Source§fn from(el: SvgLinearGradient) -> Self
fn from(el: SvgLinearGradient) -> Self
Converts to this type from the input type.
Source§impl From<SvgMetadata> for View
impl From<SvgMetadata> for View
Source§fn from(el: SvgMetadata) -> Self
fn from(el: SvgMetadata) -> Self
Converts to this type from the input type.
Source§impl From<SvgPattern> for View
impl From<SvgPattern> for View
Source§fn from(el: SvgPattern) -> Self
fn from(el: SvgPattern) -> Self
Converts to this type from the input type.
Source§impl From<SvgPolygon> for View
impl From<SvgPolygon> for View
Source§fn from(el: SvgPolygon) -> Self
fn from(el: SvgPolygon) -> Self
Converts to this type from the input type.
Source§impl From<SvgPolyline> for View
impl From<SvgPolyline> for View
Source§fn from(el: SvgPolyline) -> Self
fn from(el: SvgPolyline) -> Self
Converts to this type from the input type.
Source§impl From<SvgRadialGradient> for View
impl From<SvgRadialGradient> for View
Source§fn from(el: SvgRadialGradient) -> Self
fn from(el: SvgRadialGradient) -> Self
Converts to this type from the input type.
Source§impl From<SvgSvgScript> for View
impl From<SvgSvgScript> for View
Source§fn from(el: SvgSvgScript) -> Self
fn from(el: SvgSvgScript) -> Self
Converts to this type from the input type.
Source§impl From<SvgSvgStyle> for View
impl From<SvgSvgStyle> for View
Source§fn from(el: SvgSvgStyle) -> Self
fn from(el: SvgSvgStyle) -> Self
Converts to this type from the input type.
Source§impl From<SvgSvgTitle> for View
impl From<SvgSvgTitle> for View
Source§fn from(el: SvgSvgTitle) -> Self
fn from(el: SvgSvgTitle) -> Self
Converts to this type from the input type.
Source§impl From<SvgTextPath> for View
impl From<SvgTextPath> for View
Source§fn from(el: SvgTextPath) -> Self
fn from(el: SvgTextPath) -> Self
Converts to this type from the input type.
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: RefUnwindSafe + UnwindSafe,
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