Trait xso::DynNamespace

source ·
pub trait DynNamespace {
    type Namespace: DynNamespaceEnum;

    // Required methods
    fn namespace(&self) -> &Self::Namespace;
    fn set_namespace<T: Into<Self::Namespace>>(&mut self, ns: T);
}
Expand description

Trait for structs implementing FromXml with namespace = dyn.

This allows to access the namespace of these structs without needing knowledge about their internal structure.

Required Associated Types§

source

type Namespace: DynNamespaceEnum

The namespace enum for this struct.

Required Methods§

source

fn namespace(&self) -> &Self::Namespace

Return a reference to the struct’s namespace.

source

fn set_namespace<T: Into<Self::Namespace>>(&mut self, ns: T)

Recursively set this struct’s namespace.

This will set the namespace for the struct itself as well as for fields referring to child structs with namespace = super.

Object Safety§

This trait is not object safe.

Implementors§