pub enum Def {
Show 16 variants
Ident(DefIdent),
Function(DefIdent, Box<Def>),
AutoOr(Box<Def>),
NoneOr(Box<Def>),
AutoNoneOr(Box<Def>),
NormalOr(Box<Def>),
Type(DefType),
StyleValue(DefType),
FunctionType(DefType),
Optional(Box<Def>),
Combinator(Vec<Def>, DefCombinatorStyle),
Group(Box<Def>, DefGroupStyle),
Multiplier(Box<Def>, DefMultiplierSeparator, DefRange),
Punct(char),
IntLiteral(i32),
DimensionLiteral(f32, String),
}Variants§
Ident(DefIdent)
Function(DefIdent, Box<Def>)
AutoOr(Box<Def>)
NoneOr(Box<Def>)
AutoNoneOr(Box<Def>)
NormalOr(Box<Def>)
Type(DefType)
StyleValue(DefType)
FunctionType(DefType)
Optional(Box<Def>)
Combinator(Vec<Def>, DefCombinatorStyle)
Group(Box<Def>, DefGroupStyle)
Multiplier(Box<Def>, DefMultiplierSeparator, DefRange)
Punct(char)
IntLiteral(i32)
DimensionLiteral(f32, String)
Implementations§
Source§impl Def
impl Def
Sourcepub fn maybe_unsized(&self) -> bool
pub fn maybe_unsized(&self) -> bool
Returns true if this type is unsized, in other words it requires heap allocations to contain a full representation.
pub fn suggested_data_type(&self) -> DataType
pub fn optimize(&self) -> Self
Sourcepub fn keyword_prefix_name(&self) -> Option<&str>
pub fn keyword_prefix_name(&self) -> Option<&str>
Returns the keyword name if self is a keyword-optional-prefixed ordered sequence:
either Group(Ordered([Optional(Ident(kw)), ...])) or a bare
Combinator(Ordered, [Optional(Ident(kw)), ...]) (groups are elided by optimize()).
These need a named helper struct so that Peek includes both the optional keyword
and the required subsequent tokens.
Trait Implementations§
impl StructuralPartialEq for Def
Auto Trait Implementations§
impl Freeze for Def
impl RefUnwindSafe for Def
impl Send for Def
impl Sync for Def
impl Unpin for Def
impl UnsafeUnpin for Def
impl UnwindSafe for Def
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