Component

Struct Component 

Source
pub struct Component<Tag, Attributes, Children> {
    pub tag: Tag,
    pub attributes: Attributes,
    pub children: Children,
}

Fields§

§tag: Tag§attributes: Attributes§children: Children

Implementations§

Source§

impl Component<PhantomData<MjAttributesTag>, (), Vec<MjAttributesChild>>

Source§

impl Component<PhantomData<MjAttributesAllTag>, Map<String, Option<String>>, ()>

Source

pub fn attributes(&self) -> &AttributeMap

Source§

impl Component<PhantomData<MjBreakpointTag>, MjBreakpointAttributes, ()>

Source

pub fn value(&self) -> &str

Source§

impl Component<PhantomData<MjFontTag>, MjFontAttributes, ()>

Source

pub fn name(&self) -> &str

Source

pub fn href(&self) -> &str

Source§

impl Component<PhantomData<MjHeadTag>, (), Vec<MjHeadChild>>

Source

pub fn build_attributes_all(&self) -> Map<&str, &str>

Source

pub fn build_attributes_class(&self) -> Map<&str, Map<&str, &str>>

Source

pub fn build_attributes_element(&self) -> Map<&str, Map<&str, &str>>

Source

pub fn build_font_families(&self) -> Map<&str, &str>

Source§

impl Component<PhantomData<MjHeadTag>, (), Vec<MjHeadChild>>

Source

pub fn breakpoint(&self) -> Option<&MjBreakpoint>

Source

pub fn preview(&self) -> Option<&MjPreview>

Source

pub fn title(&self) -> Option<&MjTitle>

Source

pub fn children(&self) -> &Vec<MjHeadChild>

Source§

impl Component<PhantomData<MjPreviewTag>, (), OneOrMany<MjPreviewChild>>

Source

pub fn content(&self) -> String

Source§

impl Component<PhantomData<MjStyleTag>, MjStyleAttributes, String>

Source

pub fn is_inline(&self) -> bool

Source

pub fn children(&self) -> &str

Source§

impl Component<PhantomData<MjTitleTag>, (), String>

Source

pub fn content(&self) -> &str

Source§

impl Component<PhantomData<MjmlTag>, MjmlAttributes, MjmlChildren>

Source

pub fn parse_with_options<T: AsRef<str>>( value: T, opts: &ParserOptions, ) -> Result<ParseOutput<Self>, Error>

Function to parse a raw mjml template with some parsing options.

You can specify the kind of loader mrml needs to use for loading the content of mj-include elements.

You can take a look at the available loaders here.

use mrml::mjml::Mjml;
use mrml::prelude::parser::ParserOptions;
use mrml::prelude::parser::memory_loader::MemoryIncludeLoader;

let options = ParserOptions {
    include_loader: Box::new(MemoryIncludeLoader::default()),
};
match Mjml::parse_with_options("<mjml><mj-head /><mj-body /></mjml>", &options) {
    Ok(_) => println!("Success!"),
    Err(err) => eprintln!("Something went wrong: {err:?}"),
}
Source

pub fn parse<T: AsRef<str>>(value: T) -> Result<ParseOutput<Self>, Error>

Function to parse a raw mjml template using the default parsing options.

Source§

impl Component<PhantomData<MjmlTag>, MjmlAttributes, MjmlChildren>

Source

pub fn render(&self, opts: &RenderOptions) -> Result<String, Error>

Source

pub fn get_title(&self) -> Option<String>

Source

pub fn get_preview(&self) -> Option<String>

Source§

impl Component<PhantomData<MjmlTag>, MjmlAttributes, MjmlChildren>

Source

pub fn body(&self) -> Option<&MjBody>

Source

pub fn head(&self) -> Option<&MjHead>

Source§

impl<T, A, C> Component<PhantomData<T>, A, C>

Source

pub fn new(attributes: A, children: C) -> Self

Trait Implementations§

Source§

impl<Tag: Clone, Attributes: Clone, Children: Clone> Clone for Component<Tag, Attributes, Children>

Source§

fn clone(&self) -> Component<Tag, Attributes, Children>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Tag: Debug, Attributes: Debug, Children: Debug> Debug for Component<Tag, Attributes, Children>

Source§

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

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

impl<T: Default, A: Default, C: Default> Default for Component<T, A, C>

Source§

fn default() -> Self

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

impl<'de, Tag, Attributes, Children> Deserialize<'de> for Component<Tag, Attributes, Children>
where DeserializableTag<Tag>: Deserialize<'de>, Attributes: JsonAttributes + Deserialize<'de>, Children: JsonChildren + Deserialize<'de>,

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 From<Component<PhantomData<CommentTag>, (), String>> for MjAccordionChild

Source§

fn from(v: Comment) -> MjAccordionChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjBodyChild

Source§

fn from(v: Comment) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjCarouselChild

Source§

fn from(v: Comment) -> MjCarouselChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjHeadChild

Source§

fn from(v: Comment) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjNavbarChild

Source§

fn from(v: Comment) -> MjNavbarChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjRawChild

Source§

fn from(v: Comment) -> MjRawChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<CommentTag>, (), String>> for MjSocialChild

Source§

fn from(v: Comment) -> MjSocialChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjAccordionElementTag>, Map<String, Option<String>>, MjAccordionElementChildren>> for MjAccordionChild

Source§

fn from(v: MjAccordionElement) -> MjAccordionChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjAccordionTag>, Map<String, Option<String>>, Vec<MjAccordionChild>>> for MjBodyChild

Source§

fn from(v: MjAccordion) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjAttributesAllTag>, Map<String, Option<String>>, ()>> for MjAttributesChild

Source§

fn from(v: MjAttributesAll) -> MjAttributesChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjAttributesClassTag>, MjAttributesClassAttributes, ()>> for MjAttributesChild

Source§

fn from(v: MjAttributesClass) -> MjAttributesChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjAttributesTag>, (), Vec<MjAttributesChild>>> for MjHeadChild

Source§

fn from(v: MjAttributes) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjBreakpointTag>, MjBreakpointAttributes, ()>> for MjHeadChild

Source§

fn from(v: MjBreakpoint) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjButtonTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjButton) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjCarouselImageTag>, Map<String, Option<String>>, ()>> for MjCarouselChild

Source§

fn from(v: MjCarouselImage) -> MjCarouselChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjCarouselTag>, Map<String, Option<String>>, Vec<MjCarouselChild>>> for MjBodyChild

Source§

fn from(v: MjCarousel) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjColumnTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjColumn) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjDividerTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

fn from(v: MjDivider) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjFontTag>, MjFontAttributes, ()>> for MjHeadChild

Source§

fn from(v: MjFont) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjGroupTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjGroup) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjHeroTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjHero) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjImageTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

fn from(v: MjImage) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjNavbarLinkTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjNavbarChild

Source§

fn from(v: MjNavbarLink) -> MjNavbarChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjNavbarTag>, Map<String, Option<String>>, Vec<MjNavbarChild>>> for MjBodyChild

Source§

fn from(v: MjNavbar) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjPreviewTag>, (), OneOrMany<MjPreviewChild>>> for MjHeadChild

Source§

fn from(v: MjPreview) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjRawTag>, (), Vec<MjRawChild>>> for MjBodyChild

Source§

fn from(v: MjRaw) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjRawTag>, (), Vec<MjRawChild>>> for MjHeadChild

Source§

fn from(v: MjRaw) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjSectionTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjSection) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjSocialElementTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjSocialChild

Source§

fn from(v: MjSocialElement) -> MjSocialChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjSocialTag>, Map<String, Option<String>>, Vec<MjSocialChild>>> for MjBodyChild

Source§

fn from(v: MjSocial) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjSpacerTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

fn from(v: MjSpacer) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjStyleTag>, MjStyleAttributes, String>> for MjHeadChild

Source§

fn from(v: MjStyle) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjTableTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjTable) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjTextTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjBodyChild

Source§

fn from(v: MjText) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjTitleTag>, (), String>> for MjHeadChild

Source§

fn from(v: MjTitle) -> MjHeadChild

Converts to this type from the input type.
Source§

impl From<Component<PhantomData<MjWrapperTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: MjWrapper) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<String, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

fn from(v: Node<MjBodyChild>) -> MjBodyChild

Converts to this type from the input type.
Source§

impl From<Component<String, Map<String, Option<String>>, Vec<MjRawChild>>> for MjRawChild

Source§

fn from(v: Node<MjRawChild>) -> MjRawChild

Converts to this type from the input type.
Source§

impl<Tag: PartialEq, Attributes: PartialEq, Children: PartialEq> PartialEq for Component<Tag, Attributes, Children>

Source§

fn eq(&self, other: &Component<Tag, Attributes, Children>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Tag: StaticTag, Attributes: JsonAttributes, Children: JsonChildren> Serialize for Component<PhantomData<Tag>, Attributes, Children>

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<Child: Serialize> Serialize for Component<String, AttributeMap, Vec<Child>>

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 TryInto<Component<PhantomData<CommentTag>, (), String>> for MjAccordionChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjCarouselChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjNavbarChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjRawChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<CommentTag>, (), String>> for MjSocialChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<Comment, <Self as TryInto<Comment>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjAccordionElementTag>, Map<String, Option<String>>, MjAccordionElementChildren>> for MjAccordionChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjAccordionElement, <Self as TryInto<MjAccordionElement>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjAccordionTag>, Map<String, Option<String>>, Vec<MjAccordionChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjAccordion, <Self as TryInto<MjAccordion>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjAttributesAllTag>, Map<String, Option<String>>, ()>> for MjAttributesChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjAttributesAll, <Self as TryInto<MjAttributesAll>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjAttributesClassTag>, MjAttributesClassAttributes, ()>> for MjAttributesChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjAttributesClass, <Self as TryInto<MjAttributesClass>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjAttributesTag>, (), Vec<MjAttributesChild>>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjAttributes, <Self as TryInto<MjAttributes>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjBreakpointTag>, MjBreakpointAttributes, ()>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjBreakpoint, <Self as TryInto<MjBreakpoint>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjButtonTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjButton, <Self as TryInto<MjButton>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjCarouselImageTag>, Map<String, Option<String>>, ()>> for MjCarouselChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjCarouselImage, <Self as TryInto<MjCarouselImage>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjCarouselTag>, Map<String, Option<String>>, Vec<MjCarouselChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjCarousel, <Self as TryInto<MjCarousel>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjColumnTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjColumn, <Self as TryInto<MjColumn>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjDividerTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjDivider, <Self as TryInto<MjDivider>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjFontTag>, MjFontAttributes, ()>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjFont, <Self as TryInto<MjFont>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjGroupTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjGroup, <Self as TryInto<MjGroup>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjHeroTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjHero, <Self as TryInto<MjHero>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjImageTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjImage, <Self as TryInto<MjImage>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjNavbarLinkTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjNavbarChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjNavbarLink, <Self as TryInto<MjNavbarLink>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjNavbarTag>, Map<String, Option<String>>, Vec<MjNavbarChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjNavbar, <Self as TryInto<MjNavbar>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjPreviewTag>, (), OneOrMany<MjPreviewChild>>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjPreview, <Self as TryInto<MjPreview>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjRawTag>, (), Vec<MjRawChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjRaw, <Self as TryInto<MjRaw>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjRawTag>, (), Vec<MjRawChild>>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjRaw, <Self as TryInto<MjRaw>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjSectionTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjSection, <Self as TryInto<MjSection>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjSocialElementTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjSocialChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<MjSocialElement, <Self as TryInto<MjSocialElement>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjSocialTag>, Map<String, Option<String>>, Vec<MjSocialChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjSocial, <Self as TryInto<MjSocial>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjSpacerTag>, Map<String, Option<String>>, ()>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjSpacer, <Self as TryInto<MjSpacer>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjStyleTag>, MjStyleAttributes, String>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjStyle, <Self as TryInto<MjStyle>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjTableTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjTable, <Self as TryInto<MjTable>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjTextTag>, Map<String, Option<String>>, Vec<MjRawChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjText, <Self as TryInto<MjText>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjTitleTag>, (), String>> for MjHeadChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjTitle, <Self as TryInto<MjTitle>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<PhantomData<MjWrapperTag>, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<MjWrapper, <Self as TryInto<MjWrapper>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<String, Map<String, Option<String>>, Vec<MjBodyChild>>> for MjBodyChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<Node<MjBodyChild>, <Self as TryInto<Node<MjBodyChild>>>::Error>

Performs the conversion.
Source§

impl TryInto<Component<String, Map<String, Option<String>>, Vec<MjRawChild>>> for MjRawChild

Source§

type Error = &'static str

The type returned in the event of a conversion error.
Source§

fn try_into( self, ) -> Result<Node<MjRawChild>, <Self as TryInto<Node<MjRawChild>>>::Error>

Performs the conversion.
Source§

impl<Tag: Eq, Attributes: Eq, Children: Eq> Eq for Component<Tag, Attributes, Children>

Source§

impl<Tag, Attributes, Children> StructuralPartialEq for Component<Tag, Attributes, Children>

Auto Trait Implementations§

§

impl<Tag, Attributes, Children> Freeze for Component<Tag, Attributes, Children>
where Tag: Freeze, Attributes: Freeze, Children: Freeze,

§

impl<Tag, Attributes, Children> RefUnwindSafe for Component<Tag, Attributes, Children>
where Tag: RefUnwindSafe, Attributes: RefUnwindSafe, Children: RefUnwindSafe,

§

impl<Tag, Attributes, Children> Send for Component<Tag, Attributes, Children>
where Tag: Send, Attributes: Send, Children: Send,

§

impl<Tag, Attributes, Children> Sync for Component<Tag, Attributes, Children>
where Tag: Sync, Attributes: Sync, Children: Sync,

§

impl<Tag, Attributes, Children> Unpin for Component<Tag, Attributes, Children>
where Tag: Unpin, Attributes: Unpin, Children: Unpin,

§

impl<Tag, Attributes, Children> UnwindSafe for Component<Tag, Attributes, Children>
where Tag: UnwindSafe, Attributes: UnwindSafe, Children: UnwindSafe,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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<E> Printable for E
where E: PrintableElement,

Source§

fn print<P>(&self, printer: &mut P) -> Result<(), Error>
where P: Printer,

Source§

fn print_dense(&self) -> Result<String, Error>

Source§

fn print_pretty(&self) -> Result<String, Error>

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 = Infallible

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,