pub struct Node {
pub kind: NodeKind,
/* private fields */
}Expand description
A renderable node with shared metadata and variant-specific content.
Fields§
§kind: NodeKindThe variant-specific content of this node.
Implementations§
Source§impl Node
impl Node
Sourcepub fn container(children: impl Into<Vec<Node>>) -> Self
pub fn container(children: impl Into<Vec<Node>>) -> Self
Creates a container node with the provided child nodes.
Sourcepub fn image(data: impl Into<ImageData>) -> Self
pub fn image(data: impl Into<ImageData>) -> Self
Creates an image node from any supported image input shape.
Sourcepub fn with_tag_name(self, tag_name: impl Into<Arc<str>>) -> Self
pub fn with_tag_name(self, tag_name: impl Into<Arc<str>>) -> Self
Sets the tag name and returns the updated node.
Sourcepub fn with_class_name(self, class_name: impl Into<Box<str>>) -> Self
pub fn with_class_name(self, class_name: impl Into<Box<str>>) -> Self
Sets the class name and returns the updated node.
Sourcepub fn with_id(self, id: impl Into<Box<str>>) -> Self
pub fn with_id(self, id: impl Into<Box<str>>) -> Self
Sets the element id and returns the updated node.
Sourcepub fn with_attributes(self, attributes: BTreeMap<Box<str>, Box<str>>) -> Self
pub fn with_attributes(self, attributes: BTreeMap<Box<str>, Box<str>>) -> Self
Sets the element attributes and returns the updated node.
Sourcepub fn with_lang(self, lang: Lang) -> Self
pub fn with_lang(self, lang: Lang) -> Self
Sets the BCP-47 language tag and returns the updated node.
Sourcepub fn with_preset(self, preset: impl Into<Arc<Style>>) -> Self
pub fn with_preset(self, preset: impl Into<Arc<Style>>) -> Self
Sets the preset style and returns the updated node.
Sourcepub fn with_style(self, style: Style) -> Self
pub fn with_style(self, style: Style) -> Self
Sets the inline style and returns the updated node.
Sourcepub fn with_tw(self, tw: TailwindValues) -> Self
pub fn with_tw(self, tw: TailwindValues) -> Self
Sets the Tailwind-derived style input and returns the updated node.
Sourcepub fn image_urls(&self) -> impl Iterator<Item = &str>
pub fn image_urls(&self) -> impl Iterator<Item = &str>
Collects unique resource URLs referenced by this node tree and styles.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Node
impl<'de> Deserialize<'de> for Node
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl !Freeze for Node
impl Forget for Node
impl Move for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more