#[repr(u8)]pub enum WSP {
Space = 32,
Tab = 9,
LineFeed = 10,
FormFeed = 12,
CarriageReturn = 13,
}
Expand description
Whitespace token
Represents a whitespace character in the SVG path following the v1.1 SVG Path specification.
§Example
A path compound by whitespaces is considered a valid empty path according to the SVG Path v1.1 specification.
use svg_path_cst::{svg_path_cst, SVGPathCSTNode, WSP};
let cst = svg_path_cst(b" \t\n\r \x0C");
assert_eq!(
cst,
Ok(vec![
SVGPathCSTNode::Whitespace{
wsp: &WSP::Space,
start: 0,
end: 1,
},
SVGPathCSTNode::Whitespace{
wsp: &WSP::Tab,
start: 1,
end: 2,
},
SVGPathCSTNode::Whitespace{
wsp: &WSP::LineFeed,
start: 2,
end: 3,
},
SVGPathCSTNode::Whitespace{
wsp: &WSP::CarriageReturn,
start: 3,
end: 4,
},
SVGPathCSTNode::Whitespace{
wsp: &WSP::Space,
start: 4,
end: 5,
},
SVGPathCSTNode::Whitespace{
wsp: &WSP::FormFeed,
start: 5,
end: 6,
},
])
);
for node in cst.unwrap() {
match node {
SVGPathCSTNode::Whitespace{wsp, start, ..} => {
println!("'{}' at index {}", *wsp as u8 as char, start);
},
_ => (),
}
}
Variants§
Space = 32
Space (U+0020)
Tab = 9
Tab (U+0009)
LineFeed = 10
Line Feed (U+000A)
FormFeed = 12
Form Feed (U+000C)
CarriageReturn = 13
Carriage Return (U+000D)
Implementations§
Trait Implementations§
impl Copy for WSP
impl StructuralPartialEq for WSP
Auto Trait Implementations§
impl Freeze for WSP
impl RefUnwindSafe for WSP
impl Send for WSP
impl Sync for WSP
impl Unpin for WSP
impl UnwindSafe for WSP
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