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
)