pub enum AttributeValue {
String(String),
Boolean(bool),
Integer(i64),
Decimal(f64),
Date(NaiveDate),
DateTime(DateTime<Utc>),
Duration(Duration),
Uri(String),
Language(String),
Token(String),
Enum(String, Vec<String>),
Raw(String),
}
Expand description
Typed attribute value supporting various XML Schema types
Variants§
String(String)
String value (most common)
Boolean(bool)
Boolean value (true/false)
Integer(i64)
Integer value
Decimal(f64)
Decimal value
Date(NaiveDate)
Date value (ISO 8601)
DateTime(DateTime<Utc>)
DateTime value (ISO 8601)
Duration(Duration)
Duration value (ISO 8601)
Uri(String)
URI/URL value
Language(String)
Language code (RFC 5646)
Token(String)
Token value (normalized string)
Enum(String, Vec<String>)
Enumerated value (for known enums)
Raw(String)
Raw string value for unknown types
Implementations§
Source§impl AttributeValue
impl AttributeValue
Sourcepub fn to_xml_value(&self) -> String
pub fn to_xml_value(&self) -> String
Get the attribute value as a string for XML serialization
Sourcepub fn parse_with_type(
value: &str,
type_hint: AttributeType,
) -> Result<Self, AttributeError>
pub fn parse_with_type( value: &str, type_hint: AttributeType, ) -> Result<Self, AttributeError>
Parse an attribute value from string with type hint
Sourcepub fn validate(&self) -> Result<(), AttributeError>
pub fn validate(&self) -> Result<(), AttributeError>
Validate the attribute value
Trait Implementations§
Source§impl Clone for AttributeValue
impl Clone for AttributeValue
Source§fn clone(&self) -> AttributeValue
fn clone(&self) -> AttributeValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AttributeValue
impl Debug for AttributeValue
Source§impl<'de> Deserialize<'de> for AttributeValue
impl<'de> Deserialize<'de> for AttributeValue
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
Source§impl Display for AttributeValue
impl Display for AttributeValue
Source§impl From<&str> for AttributeValue
impl From<&str> for AttributeValue
Source§impl From<String> for AttributeValue
impl From<String> for AttributeValue
Source§impl From<bool> for AttributeValue
impl From<bool> for AttributeValue
Source§impl From<f64> for AttributeValue
impl From<f64> for AttributeValue
Source§impl From<i64> for AttributeValue
impl From<i64> for AttributeValue
Source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
Source§impl Serialize for AttributeValue
impl Serialize for AttributeValue
impl StructuralPartialEq for AttributeValue
Auto Trait Implementations§
impl Freeze for AttributeValue
impl RefUnwindSafe for AttributeValue
impl Send for AttributeValue
impl Sync for AttributeValue
impl Unpin for AttributeValue
impl UnwindSafe for AttributeValue
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