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>
Sourcepub fn is_non_rec(&self) -> bool
pub fn is_non_rec(&self) -> bool
Returns true if this is a GDeclarationGroup::NonRec, otherwise false
Sourcepub fn as_non_rec_mut(&mut self) -> Option<&mut Id>
pub fn as_non_rec_mut(&mut self) -> Option<&mut Id>
Optionally returns mutable references to the inner fields if this is a GDeclarationGroup::NonRec, otherwise None
Sourcepub fn as_non_rec(&self) -> Option<&Id>
pub fn as_non_rec(&self) -> Option<&Id>
Optionally returns references to the inner fields if this is a GDeclarationGroup::NonRec, otherwise None
Sourcepub fn into_non_rec(self) -> Result<Id, Self>
pub fn into_non_rec(self) -> Result<Id, Self>
Returns the inner fields if this is a GDeclarationGroup::NonRec, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_non_rec_unchecked(self) -> Id
pub unsafe fn into_non_rec_unchecked(self) -> Id
Unchecked return of the inner fields of GDeclarationGroup::NonRec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_non_rec_unchecked(&self) -> &Id
pub unsafe fn as_non_rec_unchecked(&self) -> &Id
Unchecked reference of the inner fields of GDeclarationGroup::NonRec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_non_rec_mut_unchecked(&mut self) -> &mut Id
pub unsafe fn as_non_rec_mut_unchecked(&mut self) -> &mut Id
Unchecked mutable reference of the inner fields of GDeclarationGroup::NonRec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub fn as_rec_mut(&mut self) -> Option<&mut Vec<Id>>
pub fn as_rec_mut(&mut self) -> Option<&mut Vec<Id>>
Optionally returns mutable references to the inner fields if this is a GDeclarationGroup::Rec, otherwise None
Sourcepub fn as_rec(&self) -> Option<&Vec<Id>>
pub fn as_rec(&self) -> Option<&Vec<Id>>
Optionally returns references to the inner fields if this is a GDeclarationGroup::Rec, otherwise None
Sourcepub fn into_rec(self) -> Result<Vec<Id>, Self>
pub fn into_rec(self) -> Result<Vec<Id>, Self>
Returns the inner fields if this is a GDeclarationGroup::Rec, otherwise returns back the enum in the Err case of the result
Sourcepub unsafe fn into_rec_unchecked(self) -> Vec<Id>
pub unsafe fn into_rec_unchecked(self) -> Vec<Id>
Unchecked return of the inner fields of GDeclarationGroup::Rec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_rec_unchecked(&self) -> &Vec<Id>
pub unsafe fn as_rec_unchecked(&self) -> &Vec<Id>
Unchecked reference of the inner fields of GDeclarationGroup::Rec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Sourcepub unsafe fn as_rec_mut_unchecked(&mut self) -> &mut Vec<Id>
pub unsafe fn as_rec_mut_unchecked(&mut self) -> &mut Vec<Id>
Unchecked mutable reference of the inner fields of GDeclarationGroup::Rec.
§Safety
Results in undefined behavior when it is the incorrect variant.
Source§impl<Id: Copy> GDeclarationGroup<Id>
impl<Id: Copy> GDeclarationGroup<Id>
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>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl<Id: Display> Display for GDeclarationGroup<Id>
impl<Id: Display> Display for GDeclarationGroup<Id>
Source§impl<Id, C: AstFormatter> FmtWithCtx<C> for GDeclarationGroup<Id>where
Id: FmtWithCtx<C> + Copy,
impl<Id, C: AstFormatter> FmtWithCtx<C> for GDeclarationGroup<Id>where
Id: FmtWithCtx<C> + Copy,
Auto Trait Implementations§
impl<Id> Freeze for GDeclarationGroup<Id>
impl<Id> RefUnwindSafe for GDeclarationGroup<Id>
impl<Id> Send for GDeclarationGroup<Id>
impl<Id> Sync for GDeclarationGroup<Id>
impl<Id> Unpin for GDeclarationGroup<Id>
impl<Id> UnsafeUnpin for GDeclarationGroup<Id>
impl<Id> UnwindSafe for GDeclarationGroup<Id>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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