Skip to main content

ChainItemKind

Enum ChainItemKind 

Source
enum ChainItemKind {
    Parent {
        expr: Expr,
        parens: bool,
    },
    MethodCall(PathSegment, Vec<GenericArg>, ThinVec<Box<Expr>>),
    StructField(Ident),
    TupleField {
        field: Ident,
        is_nested: bool,
    },
    Await,
    Use,
    Yield,
    Comment(String, CommentPosition),
}

Variants§

§

Parent

Fields

§expr: Expr
§parens: bool
§

MethodCall(PathSegment, Vec<GenericArg>, ThinVec<Box<Expr>>)

§

StructField(Ident)

§

TupleField

Tuple field access like foo.1.

Fields

§field: Ident
§is_nested: bool

Whether this is a nested tuple access, like .2 in foo.1.2.

§

Await

§

Use

§

Yield

§

Comment(String, CommentPosition)

A comment within a chain, e.g. parent. item /* comment */.rest.

Implementations§

Source§

impl ChainItemKind

Source

fn is_block_like(&self, context: &RewriteContext<'_>, reps: &str) -> bool

Source

fn is_tup_field_access_expr(expr: &Expr) -> bool

Source

fn is_tup_field_ident(field: &Ident) -> bool

Source

fn from_ast( context: &RewriteContext<'_>, expr: &Expr, is_postfix_receiver: bool, ) -> (ChainItemKind, Span)

Trait Implementations§

Source§

impl Debug for ChainItemKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl DynSend for ChainItemKind
where ThinVec<Box<Expr>>: DynSend, Box<Expr>: DynSend, Box<MethodCall>: DynSend, Box<Ty>: DynSend, Box<Pat>: DynSend, Box<Block>: DynSend, Box<ForLoop>: DynSend, ThinVec<Arm>: DynSend, Box<Closure>: DynSend, Box<QSelf>: DynSend, ThinVec<PathSegment>: DynSend, Box<InlineAsm>: DynSend, ThinVec<Ident>: DynSend, Box<MacCall>: DynSend, Box<StructExpr>: DynSend, Box<FormatArgs>: DynSend, ThinVec<Attribute>: DynSend, Arc<LazyTokenStreamInner>: DynSend, Box<GenericArgs>: DynSend, Vec<GenericArg>: DynSend, Vec<u8>: DynSend,

§

impl DynSync for ChainItemKind
where ThinVec<Box<Expr>>: DynSync, Box<Expr>: DynSync, Box<MethodCall>: DynSync, Box<Ty>: DynSync, Box<Pat>: DynSync, Box<Block>: DynSync, Box<ForLoop>: DynSync, ThinVec<Arm>: DynSync, Box<Closure>: DynSync, Box<QSelf>: DynSync, ThinVec<PathSegment>: DynSync, Box<InlineAsm>: DynSync, ThinVec<Ident>: DynSync, Box<MacCall>: DynSync, Box<StructExpr>: DynSync, Box<FormatArgs>: DynSync, ThinVec<Attribute>: DynSync, Arc<LazyTokenStreamInner>: DynSync, Box<GenericArgs>: DynSync, Vec<GenericArg>: DynSync, Vec<u8>: DynSync,

§

impl Forget for ChainItemKind

§

impl Freeze for ChainItemKind
where *const Header is !null: Freeze, PhantomData<Box<Expr>>: Freeze, *const Expr is !null: Freeze, PhantomData<Expr>: Freeze, *const MethodCall is !null: Freeze, PhantomData<MethodCall>: Freeze, *const Ty is !null: Freeze, PhantomData<Ty>: Freeze, *const Pat is !null: Freeze, PhantomData<Pat>: Freeze, *const Block is !null: Freeze, PhantomData<Block>: Freeze, *const ForLoop is !null: Freeze, PhantomData<ForLoop>: Freeze, PhantomData<Arm>: Freeze, *const Closure is !null: Freeze, PhantomData<Closure>: Freeze, *const QSelf is !null: Freeze, PhantomData<QSelf>: Freeze, PhantomData<PathSegment>: Freeze, *const InlineAsm is !null: Freeze, PhantomData<InlineAsm>: Freeze, PhantomData<Ident>: Freeze, *const MacCall is !null: Freeze, PhantomData<MacCall>: Freeze, *const StructExpr is !null: Freeze, PhantomData<StructExpr>: Freeze, *const FormatArgs is !null: Freeze, PhantomData<FormatArgs>: Freeze, PhantomData<Attribute>: Freeze, *const ArcInner<LazyTokenStreamInner> is !null: Freeze, PhantomData<ArcInner<LazyTokenStreamInner>>: Freeze, *const GenericArgs is !null: Freeze, PhantomData<GenericArgs>: Freeze, *const u8 is !null: Freeze, PhantomData<GenericArg>: Freeze, PhantomData<u8>: Freeze,

§

impl Move for ChainItemKind

§

impl RefUnwindSafe for ChainItemKind

§

impl Send for ChainItemKind
where ThinVec<Box<Expr>>: Send, BoxRaw<Expr>: Send, BoxRaw<MethodCall>: Send, BoxRaw<Ty>: Send, BoxRaw<Pat>: Send, BoxRaw<Block>: Send, BoxRaw<ForLoop>: Send, ThinVec<Arm>: Send, BoxRaw<Closure>: Send, BoxRaw<QSelf>: Send, ThinVec<PathSegment>: Send, BoxRaw<InlineAsm>: Send, ThinVec<Ident>: Send, BoxRaw<MacCall>: Send, BoxRaw<StructExpr>: Send, BoxRaw<FormatArgs>: Send, ThinVec<Attribute>: Send, Arc<LazyTokenStreamInner>: Send, BoxRaw<GenericArgs>: Send, RawVecInner: Send,

§

impl Sync for ChainItemKind
where ThinVec<Box<Expr>>: Sync, BoxRaw<Expr>: Sync, BoxRaw<MethodCall>: Sync, BoxRaw<Ty>: Sync, BoxRaw<Pat>: Sync, BoxRaw<Block>: Sync, BoxRaw<ForLoop>: Sync, ThinVec<Arm>: Sync, BoxRaw<Closure>: Sync, BoxRaw<QSelf>: Sync, ThinVec<PathSegment>: Sync, BoxRaw<InlineAsm>: Sync, ThinVec<Ident>: Sync, BoxRaw<MacCall>: Sync, BoxRaw<StructExpr>: Sync, BoxRaw<FormatArgs>: Sync, ThinVec<Attribute>: Sync, Arc<LazyTokenStreamInner>: Sync, BoxRaw<GenericArgs>: Sync, RawVecInner: Sync,

§

impl Unpin for ChainItemKind
where *const Header is !null: Unpin, Box<Expr>: Unpin, Box<MethodCall>: Unpin, Box<Ty>: Unpin, Box<Pat>: Unpin, Box<Block>: Unpin, Box<ForLoop>: Unpin, Box<NormalAttr>: Unpin, Box<SyntheticAttr>: Unpin, Box<Guard>: Unpin, Box<Closure>: Unpin, Box<QSelf>: Unpin, Box<GenericArgs>: Unpin, Box<InlineAsm>: Unpin, Box<MacCall>: Unpin, Box<StructExpr>: Unpin, Box<FormatArgs>: Unpin, Arc<LazyTokenStreamInner>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for ChainItemKind
where *const Header is !null: UnsafeUnpin, PhantomData<Box<Expr>>: UnsafeUnpin, *const Expr is !null: UnsafeUnpin, PhantomData<Expr>: UnsafeUnpin, *const MethodCall is !null: UnsafeUnpin, PhantomData<MethodCall>: UnsafeUnpin, *const Ty is !null: UnsafeUnpin, PhantomData<Ty>: UnsafeUnpin, *const Pat is !null: UnsafeUnpin, PhantomData<Pat>: UnsafeUnpin, *const Block is !null: UnsafeUnpin, PhantomData<Block>: UnsafeUnpin, *const ForLoop is !null: UnsafeUnpin, PhantomData<ForLoop>: UnsafeUnpin, PhantomData<Arm>: UnsafeUnpin, *const Closure is !null: UnsafeUnpin, PhantomData<Closure>: UnsafeUnpin, *const QSelf is !null: UnsafeUnpin, PhantomData<QSelf>: UnsafeUnpin, PhantomData<PathSegment>: UnsafeUnpin, *const InlineAsm is !null: UnsafeUnpin, PhantomData<InlineAsm>: UnsafeUnpin, PhantomData<Ident>: UnsafeUnpin, *const MacCall is !null: UnsafeUnpin, PhantomData<MacCall>: UnsafeUnpin, *const StructExpr is !null: UnsafeUnpin, PhantomData<StructExpr>: UnsafeUnpin, *const FormatArgs is !null: UnsafeUnpin, PhantomData<FormatArgs>: UnsafeUnpin, PhantomData<Attribute>: UnsafeUnpin, *const ArcInner<LazyTokenStreamInner> is !null: UnsafeUnpin, PhantomData<ArcInner<LazyTokenStreamInner>>: UnsafeUnpin, *const GenericArgs is !null: UnsafeUnpin, PhantomData<GenericArgs>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<GenericArg>: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

§

impl UnwindSafe for ChainItemKind
where NonNull<Header>: UnwindSafe, BoxRaw<Expr>: UnwindSafe, BoxRaw<MethodCall>: UnwindSafe, BoxRaw<Ty>: UnwindSafe, BoxRaw<Pat>: UnwindSafe, BoxRaw<Block>: UnwindSafe, BoxRaw<ForLoop>: UnwindSafe, BoxRaw<NormalAttr>: UnwindSafe, BoxRaw<SyntheticAttr>: UnwindSafe, BoxRaw<Guard>: UnwindSafe, BoxRaw<Closure>: UnwindSafe, BoxRaw<QSelf>: UnwindSafe, BoxRaw<GenericArgs>: UnwindSafe, BoxRaw<InlineAsm>: UnwindSafe, BoxRaw<MacCall>: UnwindSafe, BoxRaw<StructExpr>: UnwindSafe, BoxRaw<FormatArgs>: UnwindSafe, Arc<LazyTokenStreamInner>: UnwindSafe, RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. 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: 72 bytes

Size for each variant:

  • Parent: 71 bytes
  • MethodCall: 63 bytes
  • StructField: 15 bytes
  • TupleField: 15 bytes
  • Await: 0 bytes
  • Use: 0 bytes
  • Yield: 0 bytes
  • Comment: 31 bytes