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§

source

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

source§

impl FromXmlText for SocketAddr

source§

impl FromXmlText for bool

This provides an implementation compliant with xsd::bool.

source§

impl FromXmlText for f32

source§

impl FromXmlText for f64

source§

impl FromXmlText for i8

source§

impl FromXmlText for i16

source§

impl FromXmlText for i32

source§

impl FromXmlText for i64

source§

impl FromXmlText for i128

source§

impl FromXmlText for isize

source§

impl FromXmlText for u8

source§

impl FromXmlText for u16

source§

impl FromXmlText for u32

source§

impl FromXmlText for u64

source§

impl FromXmlText for u128

source§

impl FromXmlText for usize

source§

impl FromXmlText for String

source§

impl FromXmlText for Ipv4Addr

source§

impl FromXmlText for Ipv6Addr

source§

impl FromXmlText for SocketAddrV4

source§

impl FromXmlText for SocketAddrV6

source§

impl FromXmlText for Uuid

Available on crate feature uuid only.
source§

impl FromXmlText for NonZeroI8

source§

impl FromXmlText for NonZeroI16

source§

impl FromXmlText for NonZeroI32

source§

impl FromXmlText for NonZeroI64

source§

impl FromXmlText for NonZeroI128

source§

impl FromXmlText for NonZeroIsize

source§

impl FromXmlText for NonZeroU8

source§

impl FromXmlText for NonZeroU16

source§

impl FromXmlText for NonZeroU32

source§

impl FromXmlText for NonZeroU64

source§

impl FromXmlText for NonZeroU128

source§

impl FromXmlText for NonZeroUsize

source§

impl FromXmlText for BareJid

Available on crate feature jid only.
source§

impl FromXmlText for FullJid

Available on crate feature jid only.
source§

impl FromXmlText for Jid

Available on crate feature jid only.
source§

impl<T: FromXmlText> FromXmlText for Option<T>

source§

impl<T: FromXmlText> FromXmlText for Box<T>

source§

impl<T: FromXmlText, B: ToOwned<Owned = T>> FromXmlText for Cow<'_, B>

Implementors§