Trait xso::FromXmlText
source · pub trait FromXmlText: Sized {
// Required method
fn from_xml_text(data: String) -> Result<Self, Error>;
}
Expand description
Trait allowing to convert XML text to a value.
This trait is similar to std::str::FromStr
, however, due to
restrictions imposed by the orphan rule, a separate trait is needed.
Implementations for many standard library types are available. In
addition, the following feature flags can enable more implementations:
jid
:jid::Jid
,jid::BareJid
,jid::FullJid
uuid
:uuid::Uuid
Because of this unfortunate situation, we are extremely liberal with accepting optional dependencies for this purpose. You are very welcome to make merge requests against this crate adding support for parsing third-party crates.
Required Methods§
sourcefn from_xml_text(data: String) -> Result<Self, Error>
fn from_xml_text(data: String) -> Result<Self, Error>
Convert the given XML text to a value.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl FromXmlText for IpAddr
impl FromXmlText for IpAddr
source§impl FromXmlText for SocketAddr
impl FromXmlText for SocketAddr
source§impl FromXmlText for bool
impl FromXmlText for bool
This provides an implementation compliant with xsd::bool.
source§impl FromXmlText for f32
impl FromXmlText for f32
source§impl FromXmlText for f64
impl FromXmlText for f64
source§impl FromXmlText for i8
impl FromXmlText for i8
source§impl FromXmlText for i16
impl FromXmlText for i16
source§impl FromXmlText for i32
impl FromXmlText for i32
source§impl FromXmlText for i64
impl FromXmlText for i64
source§impl FromXmlText for i128
impl FromXmlText for i128
source§impl FromXmlText for isize
impl FromXmlText for isize
source§impl FromXmlText for u8
impl FromXmlText for u8
source§impl FromXmlText for u16
impl FromXmlText for u16
source§impl FromXmlText for u32
impl FromXmlText for u32
source§impl FromXmlText for u64
impl FromXmlText for u64
source§impl FromXmlText for u128
impl FromXmlText for u128
source§impl FromXmlText for usize
impl FromXmlText for usize
source§impl FromXmlText for BareJid
Available on crate feature jid
only.
impl FromXmlText for BareJid
Available on crate feature
jid
only.source§impl FromXmlText for FullJid
Available on crate feature jid
only.
impl FromXmlText for FullJid
Available on crate feature
jid
only.source§impl FromXmlText for Jid
Available on crate feature jid
only.
impl FromXmlText for Jid
Available on crate feature
jid
only.source§impl FromXmlText for String
impl FromXmlText for String
source§impl FromXmlText for Ipv4Addr
impl FromXmlText for Ipv4Addr
source§impl FromXmlText for Ipv6Addr
impl FromXmlText for Ipv6Addr
source§impl FromXmlText for SocketAddrV4
impl FromXmlText for SocketAddrV4
source§impl FromXmlText for SocketAddrV6
impl FromXmlText for SocketAddrV6
source§impl FromXmlText for Uuid
Available on crate feature uuid
only.
impl FromXmlText for Uuid
Available on crate feature
uuid
only.