[][src]Struct xml::namespace::CheckedTarget

pub struct CheckedTarget<'a>(_);

A wrapper around NamespaceStack which implements Extend using put_checked().

Example


let mut nst = NamespaceStack::empty();
nst.push_empty();
nst.put("a", "urn:A");
nst.put("b", "urn:B");
nst.push_empty();
nst.put("c", "urn:C");

nst.checked_target().extend(vec![("a", "urn:Z"), ("b", "urn:B"), ("c", "urn:Y"), ("d", "urn:D")]);
assert_eq!(
    vec![("a", "urn:Z"), ("c", "urn:C"), ("d", "urn:D"), ("b", "urn:B")],
    nst.iter().collect::<Vec<_>>()
);

Compare:


nst.extend(vec![("a", "urn:Z"), ("b", "urn:B"), ("c", "urn:Y"), ("d", "urn:D")]);
assert_eq!(
    vec![("a", "urn:Z"), ("b", "urn:B"), ("c", "urn:C"), ("d", "urn:D")],
    nst.iter().collect::<Vec<_>>()
);

Trait Implementations

impl<'a, 'b> Extend<(&'b str, &'b str)> for CheckedTarget<'a>[src]

Auto Trait Implementations

impl<'a> Send for CheckedTarget<'a>

impl<'a> Unpin for CheckedTarget<'a>

impl<'a> Sync for CheckedTarget<'a>

impl<'a> !UnwindSafe for CheckedTarget<'a>

impl<'a> RefUnwindSafe for CheckedTarget<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]