pub enum Expression<'src> {
Show 16 variants
AddressRange {
end: i128,
start: i128,
},
ByteArray(Vec<u8>),
BaseType(BaseType),
Integer(Integer),
Allow,
Number(i128),
DefaultNumber(Option<i128>),
CatchAllNumber(Option<i128>),
String(&'src str),
Access(Access),
ByteOrder(ByteOrder),
TypeReference(Ident<'src>),
SubNode(Box<Node<'src>>),
Auto,
AddressMode(AddressMode),
Error,
}Variants§
AddressRange
ByteArray(Vec<u8>)
BaseType(BaseType)
Integer(Integer)
Allow
Number(i128)
DefaultNumber(Option<i128>)
CatchAllNumber(Option<i128>)
String(&'src str)
Access(Access)
ByteOrder(ByteOrder)
TypeReference(Ident<'src>)
SubNode(Box<Node<'src>>)
Auto
AddressMode(AddressMode)
Error
Implementations§
Source§impl<'src> Expression<'src>
impl<'src> Expression<'src>
pub fn as_range(&self) -> Option<(i128, i128)>
pub fn as_byte_order(&self) -> Option<ByteOrder>
pub fn as_access(&self) -> Option<Access>
pub fn as_integer(&self) -> Option<Integer>
pub fn as_unsigned_integer(&self) -> Option<Integer>
pub fn as_number(&self) -> Option<i128>
pub fn as_string(&self) -> Option<&'src str>
pub fn as_address_mode(&self) -> Option<AddressMode>
pub fn get_human_string(&self) -> Cow<'static, str>
Trait Implementations§
Source§impl<'src> Clone for Expression<'src>
impl<'src> Clone for Expression<'src>
Source§fn clone(&self) -> Expression<'src>
fn clone(&self) -> Expression<'src>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'src> Debug for Expression<'src>
impl<'src> Debug for Expression<'src>
Auto Trait Implementations§
impl<'src> Freeze for Expression<'src>
impl<'src> RefUnwindSafe for Expression<'src>
impl<'src> Send for Expression<'src>
impl<'src> Sync for Expression<'src>
impl<'src> Unpin for Expression<'src>
impl<'src> UnsafeUnpin for Expression<'src>
impl<'src> UnwindSafe for Expression<'src>
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T> SpanExt for T
impl<T> SpanExt for T
fn with_span(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Source§fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
fn spanned(self, span: impl Into<Span>) -> Spanned<Self>where
Self: Sized,
Same as
Self::with_span, but can avoid name collisionsfn with_dummy_span(self) -> Spanned<Self>where
Self: Sized,
fn into_with_dummy_span<T>(self) -> Spanned<T>where
Self: Into<T>,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.