pub struct CustomMeta {
pub name: String,
pub include: Option<String>,
pub default: Option<ValueGeneratorBox>,
pub namespaces: Vec<CustomMetaNamespace>,
pub allow_any: bool,
}Expand description
Type information for a custom defined type.
Fields§
§name: StringName of the custom defined type.
include: Option<String>The path the type should be included from.
The path should be absolute, or relative to the root of the generated code.
default: Option<ValueGeneratorBox>The handler for the default values for this custom defined type.
This is used to translate default values specified in the XSD schema, to suitable rust code.
namespaces: Vec<CustomMetaNamespace>The namespaces needed by this custom type.
allow_any: boolWether this custom type contains xs:any elements or not.
Implementations§
Source§impl CustomMeta
impl CustomMeta
Sourcepub fn include_from<X>(self, include: X) -> Self
pub fn include_from<X>(self, include: X) -> Self
The the path the type should be included from.
The path should be absolute, or relative to the root of the generated code.
Sourcepub fn with_default<X: ValueGenerator>(self, x: X) -> Self
pub fn with_default<X: ValueGenerator>(self, x: X) -> Self
Set the handler for the default values for this custom defined type.
Sourcepub fn with_namespace<N>(self, ns: N) -> Selfwhere
N: Into<CustomMetaNamespace>,
pub fn with_namespace<N>(self, ns: N) -> Selfwhere
N: Into<CustomMetaNamespace>,
Add a namespace that is needed by this custom type.
The namespace may be added to the root element during serialization.
Sourcepub fn namespaces(&self) -> &[CustomMetaNamespace]
pub fn namespaces(&self) -> &[CustomMetaNamespace]
Returns the namespaces needed by this custom type.
Sourcepub fn allow_any(&self) -> bool
pub fn allow_any(&self) -> bool
Returns true if this type contains xs:any elements, false otherwise.
Sourcepub fn with_allow_any(self, value: bool) -> Self
pub fn with_allow_any(self, value: bool) -> Self
Set wether this custom type containsxs:any elements or not.
Trait Implementations§
Source§impl Clone for CustomMeta
impl Clone for CustomMeta
Source§impl Debug for CustomMeta
impl Debug for CustomMeta
Source§impl From<CustomMeta> for MetaType
impl From<CustomMeta> for MetaType
Source§fn from(value: CustomMeta) -> Self
fn from(value: CustomMeta) -> Self
Source§impl Hash for CustomMeta
impl Hash for CustomMeta
Source§impl PartialEq for CustomMeta
impl PartialEq for CustomMeta
impl Eq for CustomMeta
Auto Trait Implementations§
impl Freeze for CustomMeta
impl !RefUnwindSafe for CustomMeta
impl Send for CustomMeta
impl Sync for CustomMeta
impl Unpin for CustomMeta
impl UnsafeUnpin for CustomMeta
impl !UnwindSafe for CustomMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.