Enum rustc_hir::hir::GeneratorKind
source · [−]pub enum GeneratorKind {
Async(AsyncGeneratorKind),
Gen,
}
Expand description
The type of source expression that caused this generator to be created.
Variants
Async(AsyncGeneratorKind)
An explicit async
block or the body of an async function.
Gen
A generator literal created via a yield
inside a closure.
Implementations
sourceimpl GeneratorKind
impl GeneratorKind
Trait Implementations
sourceimpl Clone for GeneratorKind
impl Clone for GeneratorKind
sourcefn clone(&self) -> GeneratorKind
fn clone(&self) -> GeneratorKind
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for GeneratorKind
impl Debug for GeneratorKind
sourceimpl<__D: Decoder> Decodable<__D> for GeneratorKind
impl<__D: Decoder> Decodable<__D> for GeneratorKind
sourceimpl Display for GeneratorKind
impl Display for GeneratorKind
sourceimpl<__E: Encoder> Encodable<__E> for GeneratorKind
impl<__E: Encoder> Encodable<__E> for GeneratorKind
sourceimpl From<GeneratorKind> for YieldSource
impl From<GeneratorKind> for YieldSource
sourcefn from(kind: GeneratorKind) -> Self
fn from(kind: GeneratorKind) -> Self
Converts to this type from the input type.
sourceimpl Hash for GeneratorKind
impl Hash for GeneratorKind
sourceimpl<__CTX> HashStable<__CTX> for GeneratorKind where
__CTX: HashStableContext,
impl<__CTX> HashStable<__CTX> for GeneratorKind where
__CTX: HashStableContext,
fn hash_stable(&self, __hcx: &mut __CTX, __hasher: &mut StableHasher)
sourceimpl PartialEq<GeneratorKind> for GeneratorKind
impl PartialEq<GeneratorKind> for GeneratorKind
sourcefn eq(&self, other: &GeneratorKind) -> bool
fn eq(&self, other: &GeneratorKind) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &GeneratorKind) -> bool
fn ne(&self, other: &GeneratorKind) -> bool
This method tests for !=
.
sourceimpl PartialOrd<GeneratorKind> for GeneratorKind
impl PartialOrd<GeneratorKind> for GeneratorKind
sourcefn partial_cmp(&self, other: &GeneratorKind) -> Option<Ordering>
fn partial_cmp(&self, other: &GeneratorKind) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for GeneratorKind
impl Eq for GeneratorKind
impl StructuralEq for GeneratorKind
impl StructuralPartialEq for GeneratorKind
Auto Trait Implementations
impl RefUnwindSafe for GeneratorKind
impl Send for GeneratorKind
impl Sync for GeneratorKind
impl Unpin for GeneratorKind
impl UnwindSafe for GeneratorKind
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
Layout
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Async
: 1 byteGen
: 0 bytes