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§
Sourcetype ChildrenAccess: SeqAccess<'de, Error = Self::Error>
type ChildrenAccess: SeqAccess<'de, Error = Self::Error>
The type of the children accessor returned by ElementAccess::children.
Sourcetype DeserializeContext<'a>: DeserializeContext + 'a
where
Self: 'a
type DeserializeContext<'a>: DeserializeContext + 'a where Self: 'a
The type of the namespace context returned by ElementAccess::context.
Required Methods§
Sourcefn name(&self) -> ExpandedName<'_>
fn name(&self) -> ExpandedName<'_>
Returns the name of the element.
Sourcefn children(self) -> Result<Self::ChildrenAccess, Self::Error>
fn children(self) -> Result<Self::ChildrenAccess, Self::Error>
Returns an accessor for the element’s children.
Sourcefn context(&self) -> Self::DeserializeContext<'_>
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.