pub enum Content<'a> {
Text(String),
Value(XPathValue<Nav<'a>>),
Element(Form<'a>),
Comment(String),
Pi(String, String),
}Expand description
One item of an element’s content.
use xsd_schema::compose::{Content, Form, Name};
let mut form = Form::new(Name::local("p"));
form.push(Content::Text("hello".to_string()));
form.push(Content::Comment(" note ".to_string()));
assert_eq!(form.content().len(), 2);Variants§
Text(String)
Literal text. Two adjacent texts concatenate with no separator.
Value(XPathValue<Nav<'a>>)
A sequence, emitted with the constructor content rules: atomic values are space-separated from each other, nodes are copied.
Element(Form<'a>)
A child element.
Comment(String)
A comment.
Pi(String, String)
A processing instruction: target, then data.
Trait Implementations§
Source§impl<'a> IntoContent<'a> for Content<'a>
impl<'a> IntoContent<'a> for Content<'a>
Source§fn into_content(self) -> Content<'a>
fn into_content(self) -> Content<'a>
Converts
self into one content item.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Content<'a>
impl<'a> !Send for Content<'a>
impl<'a> !Sync for Content<'a>
impl<'a> !UnwindSafe for Content<'a>
impl<'a> Forget for Content<'a>
impl<'a> Freeze for Content<'a>where
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
&'a BufferDocument<'a>: Freeze,
PhantomData<NsRef>: Freeze,
&'a SharedClock: Freeze,
NonZero<u32>: Freeze,
PhantomData<u64>: Freeze,
*const ArcInner<QNameParts> is !null: Freeze,
PhantomData<ArcInner<QNameParts>>: Freeze,
PhantomData<XmlValue>: Freeze,
*const XmlValue is !null: Freeze,
PhantomData<XmlItem<BufferDocNavigator<'a>>>: Freeze,
PhantomData<(String, String)>: Freeze,
PhantomData<(Name, AttrValue<'a>)>: Freeze,
PhantomData<Content<'a>>: Freeze,
impl<'a> Move for Content<'a>
impl<'a> Unpin for Content<'a>
impl<'a> UnsafeUnpin for Content<'a>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
&'a BufferDocument<'a>: UnsafeUnpin,
PhantomData<NsRef>: UnsafeUnpin,
&'a SharedClock: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
*const ArcInner<QNameParts> is !null: UnsafeUnpin,
PhantomData<ArcInner<QNameParts>>: UnsafeUnpin,
PhantomData<XmlValue>: UnsafeUnpin,
*const XmlValue is !null: UnsafeUnpin,
PhantomData<XmlItem<BufferDocNavigator<'a>>>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
PhantomData<(Name, AttrValue<'a>)>: UnsafeUnpin,
PhantomData<Content<'a>>: UnsafeUnpin,
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