pub struct Attribute { /* private fields */ }Expand description
One XML attribute with both lexical and resolved namespace identity.
Implementations§
Source§impl Attribute
impl Attribute
Sourcepub fn new(
prefix: Option<&str>,
local_name: &str,
namespace_uri: Option<&str>,
value: impl Into<String>,
) -> Self
pub fn new( prefix: Option<&str>, local_name: &str, namespace_uri: Option<&str>, value: impl Into<String>, ) -> Self
Builds an unqualified or prefixed attribute for programmatic construction.
namespace_uri is the attribute’s resolved namespace, independent of
prefix: callers building a standalone tree are responsible for also
declaring the xmlns:* binding on an enclosing element if one is
required, since this constructor does not synthesize declarations.
pub fn qname(&self) -> &str
pub fn prefix(&self) -> Option<&str>
pub fn local_name(&self) -> &str
pub fn namespace_uri(&self) -> Option<&str>
pub fn value(&self) -> &str
Trait Implementations§
impl Eq for Attribute
impl StructuralPartialEq for Attribute
Auto Trait Implementations§
impl Freeze for Attribute
impl RefUnwindSafe for Attribute
impl Send for Attribute
impl Sync for Attribute
impl Unpin for Attribute
impl UnsafeUnpin for Attribute
impl UnwindSafe for Attribute
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