Struct typescript_type_def::type_expr::TypeIntersection[][src]

pub struct TypeIntersection {
    pub docs: Option<Docs>,
    pub members: List<TypeExpr>,
}
Expand description

A TypeScript intersection type.

Note that not all valid TypeScript intersection types are possible to represent using JSON. In general, only object types with disjoint fields can be intersected and still be accurately encoded as JSON (the resulting type being an object with the combined fields of all the intersection members).

Fields

docs: Option<Docs>

The documentation for this intersection.

members: List<TypeExpr>

The types that comprise this intersection.

If the members are empty, this type describes the vacuous intersection type which is equivalent to any. If the members contain only one type, this type is equivalent to that type.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.