pub struct Text { /* private fields */ }
Expand description
A Text
is contained by the Token::Text
variant.
See the XML 1.1 specification for details.
Implementations§
Source§impl Text
impl Text
Sourcepub fn get_as_str(&self) -> &str
pub fn get_as_str(&self) -> &str
Returns the text as a &str
.
Sourcepub fn normalize_space(&self) -> String
pub fn normalize_space(&self) -> String
Return a space normalized String
where whitespace is trimmed
from the head and tail, and duplicate whitespace is replaced
with a single space character in the body.
Sourcepub fn deduplicate_whitespace(&self) -> String
pub fn deduplicate_whitespace(&self) -> String
Return a space deduplicated String
where duplicate
whitespace is replaced with a single space character.
Sourcepub fn normalize_space_deduplicate_head(&self) -> String
pub fn normalize_space_deduplicate_head(&self) -> String
Return a space normalized String
but whitespace is only
deduplicated from the head, rather than trimmed entirley.
Sourcepub fn normalize_space_deduplicate_tail(&self) -> String
pub fn normalize_space_deduplicate_tail(&self) -> String
Return a space normalized String
but whitespace is only
deduplicated from the tail, rather than trimmed entirley.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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