pub struct Element {
pub name: String,
pub attributes: Vec<(String, String)>,
pub children: Vec<Node>,
}Expand description
An XML element: its name, its attributes in the order they were written, and its children.
Fields§
§name: StringThe element’s name, such as nosecone.
attributes: Vec<(String, String)>The attributes, in document order, as name and value.
children: Vec<Node>The children, in document order.
Implementations§
Source§impl Element
impl Element
Sourcepub fn attribute(&self, name: &str) -> Option<&str>
pub fn attribute(&self, name: &str) -> Option<&str>
The value of the attribute called name, if it has one.
Sourcepub fn children_named<'a>(
&'a self,
name: &str,
) -> impl Iterator<Item = &'a Element>
pub fn children_named<'a>( &'a self, name: &str, ) -> impl Iterator<Item = &'a Element>
The child elements called name, in document order.
Sourcepub fn child<'a>(&'a self, name: &str) -> Option<&'a Element>
pub fn child<'a>(&'a self, name: &str) -> Option<&'a Element>
The first child element called name.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Element
impl<'de> Deserialize<'de> for Element
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Element
Source§impl JsonSchema for Element
impl JsonSchema for Element
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Element
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.