ElementAccess

Trait ElementAccess 

Source
pub trait ElementAccess<'de>: AttributesAccess<'de> {
    type ChildrenAccess: SeqAccess<'de, Error = Self::Error>;
    type DeserializeContext<'a>: DeserializeContext + 'a
       where Self: 'a;

    // Required methods
    fn name(&self) -> ExpandedName<'_>;
    fn children(self) -> Result<Self::ChildrenAccess, Self::Error>;
    fn context(&self) -> Self::DeserializeContext<'_>;
}
Expand description

A trait for accessing properties of an element. This is the first stage of element deserialization, where the element’s name and attributes are accessed. The second stage is accessing the element’s children, which is done by calling ElementAccess::children.

Required Associated Types§

Source

type ChildrenAccess: SeqAccess<'de, Error = Self::Error>

The type of the children accessor returned by ElementAccess::children.

Source

type DeserializeContext<'a>: DeserializeContext + 'a where Self: 'a

The type of the namespace context returned by ElementAccess::context.

Required Methods§

Source

fn name(&self) -> ExpandedName<'_>

Returns the name of the element.

Source

fn children(self) -> Result<Self::ChildrenAccess, Self::Error>

Returns an accessor for the element’s children.

Source

fn context(&self) -> Self::DeserializeContext<'_>

Returns the namespace context for this attribute.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§