pub struct Namespace<'a>(pub &'a [u8]);
Expand description
A namespace name that is declared in a xmlns[:prefix]="namespace name"
.
Tuple Fields§
§0: &'a [u8]
Implementations§
Source§impl<'a> Namespace<'a>
impl<'a> Namespace<'a>
Sourcepub const fn into_inner(self) -> &'a [u8] ⓘ
pub const fn into_inner(self) -> &'a [u8] ⓘ
Converts this namespace to an internal slice representation.
This is non-normalized attribute value, i.e. any entity references is not expanded and space characters are not removed. This means, that different byte slices, returned from this method, can represent the same namespace and would be treated by parser as identical.
For example, if the entity eacute has been defined to be é,
the empty tags below all contain namespace declarations binding the
prefix p
to the same IRI reference, http://example.org/rosé
.
<p:foo xmlns:p="http://example.org/rosé" />
<p:foo xmlns:p="http://example.org/rosé" />
<p:foo xmlns:p="http://example.org/rosé" />
<p:foo xmlns:p="http://example.org/rosé" />
<p:foo xmlns:p="http://example.org/rosé" />
This is because XML entity references are expanded during attribute value normalization.
Trait Implementations§
Source§impl<'de: 'a, 'a> Deserialize<'de> for Namespace<'a>
impl<'de: 'a, 'a> Deserialize<'de> for Namespace<'a>
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<'a> Ord for Namespace<'a>
impl<'a> Ord for Namespace<'a>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> PartialOrd for Namespace<'a>
impl<'a> PartialOrd for Namespace<'a>
impl<'a> Copy for Namespace<'a>
impl<'a> Eq for Namespace<'a>
impl<'a> StructuralPartialEq for Namespace<'a>
Auto Trait Implementations§
impl<'a> Freeze for Namespace<'a>
impl<'a> RefUnwindSafe for Namespace<'a>
impl<'a> Send for Namespace<'a>
impl<'a> Sync for Namespace<'a>
impl<'a> Unpin for Namespace<'a>
impl<'a> UnwindSafe for Namespace<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)