pub enum GDeclarationGroup<Id> {
NonRec(Id),
Rec(Vec<Id>),
}
Expand description
A (group of) top-level declaration(s), properly reordered. “G” stands for “generic”
Variants§
Implementations§
source§impl<Id> GDeclarationGroup<Id>
impl<Id> GDeclarationGroup<Id>
pub fn variant_index_arity(&self) -> (u32, usize)
source§impl<Id> GDeclarationGroup<Id>
impl<Id> GDeclarationGroup<Id>
pub fn variant_name(&self) -> &'static str
source§impl<Id> GDeclarationGroup<Id>
impl<Id> GDeclarationGroup<Id>
source§impl<Id> GDeclarationGroup<Id>
impl<Id> GDeclarationGroup<Id>
pub fn as_non_rec_mut(&mut self) -> Option<&mut Id>
pub fn as_rec_mut(&mut self) -> Option<&mut Vec<Id>>
source§impl<Id> GDeclarationGroup<Id>
impl<Id> GDeclarationGroup<Id>
source§impl<Id: Copy> GDeclarationGroup<Id>
impl<Id: Copy> GDeclarationGroup<Id>
pub fn get_ids(&self) -> &[Id]
pub fn get_any_trans_ids(&self) -> Vec<AnyTransId>where
Id: Into<AnyTransId>,
fn make_group(is_rec: bool, gr: impl Iterator<Item = AnyTransId>) -> Self
fn to_mixed(&self) -> GDeclarationGroup<AnyTransId>where
Id: Into<AnyTransId>,
Trait Implementations§
source§impl<Id: Clone> Clone for GDeclarationGroup<Id>
impl<Id: Clone> Clone for GDeclarationGroup<Id>
source§fn clone(&self) -> GDeclarationGroup<Id>
fn clone(&self) -> GDeclarationGroup<Id>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Id: Debug> Debug for GDeclarationGroup<Id>
impl<Id: Debug> Debug for GDeclarationGroup<Id>
source§impl<'de, Id> Deserialize<'de> for GDeclarationGroup<Id>where
Id: Deserialize<'de>,
impl<'de, Id> Deserialize<'de> for GDeclarationGroup<Id>where
Id: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<Id: Display> Display for GDeclarationGroup<Id>
impl<Id: Display> Display for GDeclarationGroup<Id>
source§impl<Id: Copy, C: AstFormatter + Formatter<Id>> FmtWithCtx<C> for GDeclarationGroup<Id>
impl<Id: Copy, C: AstFormatter + Formatter<Id>> FmtWithCtx<C> for GDeclarationGroup<Id>
Auto Trait Implementations§
impl<Id> Freeze for GDeclarationGroup<Id>where
Id: Freeze,
impl<Id> RefUnwindSafe for GDeclarationGroup<Id>where
Id: RefUnwindSafe,
impl<Id> Send for GDeclarationGroup<Id>where
Id: Send,
impl<Id> Sync for GDeclarationGroup<Id>where
Id: Sync,
impl<Id> Unpin for GDeclarationGroup<Id>where
Id: Unpin,
impl<Id> UnwindSafe for GDeclarationGroup<Id>where
Id: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Indentable for Twhere
T: Display,
impl<T> Indentable for Twhere
T: Display,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more