pub struct IntersectionType {
pub left: Box<Type>,
pub right: Box<Type>,
}
Expand description
An intersection type.
Example:
type T = { name: string } & { value: number };
// ------------- ^ ----------------
See: https://www.typescriptlang.org/docs/handbook/2/objects.html#intersection-types
Fields§
§left: Box<Type>
The left-hand side of the intersection.
right: Box<Type>
The right-hand side of the intersection.
Trait Implementations§
Source§impl Clone for IntersectionType
impl Clone for IntersectionType
Source§fn clone(&self) -> IntersectionType
fn clone(&self) -> IntersectionType
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IntersectionType
impl Debug for IntersectionType
Source§impl Display for IntersectionType
impl Display for IntersectionType
Source§impl From<IntersectionType> for Type
impl From<IntersectionType> for Type
Source§fn from(value: IntersectionType) -> Self
fn from(value: IntersectionType) -> Self
Converts to this type from the input type.
Source§impl PartialEq for IntersectionType
impl PartialEq for IntersectionType
impl StructuralPartialEq for IntersectionType
Auto Trait Implementations§
impl Freeze for IntersectionType
impl RefUnwindSafe for IntersectionType
impl Send for IntersectionType
impl Sync for IntersectionType
impl Unpin for IntersectionType
impl UnwindSafe for IntersectionType
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