pub enum ModRef<'a> {
Module(&'a ModModule),
Expression(&'a ModExpression),
}Expand description
See also mod
Variants§
Module(&'a ModModule)
Expression(&'a ModExpression)
Implementations§
Source§impl<'a> ModRef<'a>
impl<'a> ModRef<'a>
Sourcepub fn as_module(&self) -> Option<&&'a ModModule>
pub fn as_module(&self) -> Option<&&'a ModModule>
Returns Some if self is a reference of variant Module, and None otherwise.
Sourcepub fn as_mut_module(&mut self) -> Option<&mut &'a ModModule>
pub fn as_mut_module(&mut self) -> Option<&mut &'a ModModule>
Returns Some if self is a mutable reference of variant Module, and None otherwise.
Sourcepub fn expect_module(self) -> &'a ModModule
pub fn expect_module(self) -> &'a ModModule
Sourcepub fn module(self) -> Option<&'a ModModule>
pub fn module(self) -> Option<&'a ModModule>
Returns Some if self is of variant Module, and None otherwise.
Sourcepub const fn is_expression(&self) -> bool
pub const fn is_expression(&self) -> bool
Returns true if self is of variant Expression.
Sourcepub fn as_expression(&self) -> Option<&&'a ModExpression>
pub fn as_expression(&self) -> Option<&&'a ModExpression>
Returns Some if self is a reference of variant Expression, and None otherwise.
Sourcepub fn as_mut_expression(&mut self) -> Option<&mut &'a ModExpression>
pub fn as_mut_expression(&mut self) -> Option<&mut &'a ModExpression>
Returns Some if self is a mutable reference of variant Expression, and None otherwise.
Sourcepub fn expect_expression(self) -> &'a ModExpression
pub fn expect_expression(self) -> &'a ModExpression
Unwraps the value, yielding the content of Expression.
§Panics
Panics if the value is not Expression. In debug builds the panic message includes the content of self.
Sourcepub fn expression(self) -> Option<&'a ModExpression>
pub fn expression(self) -> Option<&'a ModExpression>
Returns Some if self is of variant Expression, and None otherwise.
Trait Implementations§
impl<'a> Copy for ModRef<'a>
Source§impl<'a> From<&'a ModExpression> for ModRef<'a>
impl<'a> From<&'a ModExpression> for ModRef<'a>
Source§fn from(node: &'a ModExpression) -> ModRef<'a>
fn from(node: &'a ModExpression) -> ModRef<'a>
Converts to this type from the input type.
Source§impl<'a> From<ModRef<'a>> for AnyNodeRef<'a>
impl<'a> From<ModRef<'a>> for AnyNodeRef<'a>
Source§fn from(node: ModRef<'a>) -> AnyNodeRef<'a>
fn from(node: ModRef<'a>) -> AnyNodeRef<'a>
Converts to this type from the input type.
Source§impl<'a> GetSize for ModRef<'a>
impl<'a> GetSize for ModRef<'a>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Determines how many bytes this object occupies inside the heap. Read more
Source§fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
Determines how many bytes this object occupies inside the heap while using a
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Determines how may bytes this object occupies inside the stack. Read more
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
Determines the total size of the object while using a
tracker. Read moreSource§impl HasNodeIndex for ModRef<'_>
impl HasNodeIndex for ModRef<'_>
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
Returns the
AtomicNodeIndex for this node.impl<'a> StructuralPartialEq for ModRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ModRef<'a>
impl<'a> RefUnwindSafe for ModRef<'a>
impl<'a> Send for ModRef<'a>
impl<'a> Sync for ModRef<'a>
impl<'a> Unpin for ModRef<'a>
impl<'a> UnsafeUnpin for ModRef<'a>
impl<'a> UnwindSafe for ModRef<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> Helper for T
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
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 more