pub struct Element {
pub meta: &'static ElementMeta,
pub attr: ASlice<(KString, KString)>,
pub body: ASlice<Node>,
}Expand description
Invalid Elements can definitely be built (non-allowed child
elements), but still has public fields since it will be plucked
apart and verified in allocate_element before being stored. And
there’s no mut access to the store.
Fields§
§meta: &'static ElementMeta§attr: ASlice<(KString, KString)>§body: ASlice<Node>Implementations§
Source§impl Element
impl Element
pub fn meta(&self) -> &'static ElementMeta
pub fn attr(&self) -> &ASlice<(KString, KString)>
pub fn body(&self) -> &ASlice<Node>
pub fn try_filter_map_body<'a, T: AllocatorType>( &self, f: impl Fn(AId<Node>) -> Result<Option<AId<Node>>>, allocator: &'a HtmlAllocator, ) -> Result<Element>
Source§impl Element
impl Element
pub fn try_flat_map_body<'a, T: AllocatorType>( &self, f: impl Fn(AId<Node>) -> Result<Flat<Node>>, allocator: &'a HtmlAllocator, ) -> Result<Element>
Trait Implementations§
Source§impl Print for Element
impl Print for Element
Source§fn print_html_fragment(
&self,
out: &mut impl Write,
allocator: &HtmlAllocator,
) -> Result<()>
fn print_html_fragment( &self, out: &mut impl Write, allocator: &HtmlAllocator, ) -> Result<()>
Print serialized HTML.
Source§fn print_plain(&self, out: &mut String, allocator: &HtmlAllocator) -> Result<()>
fn print_plain(&self, out: &mut String, allocator: &HtmlAllocator) -> Result<()>
Print plain text, completely ignoring HTML markup. Can
currently only give an error if encountering preserialized
HTML.
fn to_html_fragment_string(&self, allocator: &HtmlAllocator) -> Result<String>
fn to_plain_string(&self, allocator: &HtmlAllocator) -> Result<String>
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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