pub enum WsPolicy {
None,
SpaceRun,
ZeroOrMore,
OneOrMore,
ExactSpace,
Newline,
Tab,
}Expand description
How a template literal run of whitespace matches input (§7.2).
Variants§
None
The literal had no whitespace run in front of it, so no whitespace is consumed before matching it.
This variant is what lets SpaceRun mean what it
says. Without it every literal would be tagged SpaceRun whether or not
the template wrote a space run, the interpreter could not tell the two
apart, and the only way to keep templates matching would be to implement
SpaceRun as zero-or-more — contradicting its own definition.
SpaceRun
A run of ordinary spaces matches one or more spaces or tabs (the default, flexible rule for AoC column alignment, §7.2).
ZeroOrMore
\s* — zero or more spaces or tabs.
OneOrMore
\s+ — one or more spaces or tabs.
ExactSpace
\x20 — exactly one ASCII space.
Newline
\n — one line ending.
Tab
\t — one tab.
Trait Implementations§
impl Copy for WsPolicy
impl Eq for WsPolicy
impl StructuralPartialEq for WsPolicy
Auto Trait Implementations§
impl Freeze for WsPolicy
impl RefUnwindSafe for WsPolicy
impl Send for WsPolicy
impl Sync for WsPolicy
impl Unpin for WsPolicy
impl UnsafeUnpin for WsPolicy
impl UnwindSafe for WsPolicy
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