#[non_exhaustive]#[repr(C)]pub struct TSInterfaceDeclaration<'a> {
pub span: Span,
pub node_id: Cell<NodeId>,
pub scope_id: Cell<Option<ScopeId>>,
pub id: BindingIdentifier<'a>,
pub type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
pub extends: Vec<'a, TSInterfaceHeritage<'a>>,
pub body: Box<'a, TSInterfaceBody<'a>>,
pub declare: bool,
}Expand description
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.span: Span§node_id: Cell<NodeId>§scope_id: Cell<Option<ScopeId>>§id: BindingIdentifier<'a>The identifier (name) of the interface.
type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>Type parameters that get bound to the interface.
extends: Vec<'a, TSInterfaceHeritage<'a>>Other interfaces/types this interface extends.
body: Box<'a, TSInterfaceBody<'a>>§declare: booltrue for declare interface Foo {}
Implementations§
Source§impl<'a> TSInterfaceDeclaration<'a>
impl<'a> TSInterfaceDeclaration<'a>
Sourcepub fn new(
span: Span,
id: BindingIdentifier<'a>,
type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>,
body: Box<'a, TSInterfaceBody<'a>>,
declare: bool,
builder: &impl GetAstBuilder<'a>,
) -> TSInterfaceDeclaration<'a>
pub fn new( span: Span, id: BindingIdentifier<'a>, type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>, extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>, body: Box<'a, TSInterfaceBody<'a>>, declare: bool, builder: &impl GetAstBuilder<'a>, ) -> TSInterfaceDeclaration<'a>
Build a TSInterfaceDeclaration.
If you want the built node to be allocated in the memory arena,
use TSInterfaceDeclaration::boxed instead.
§Parameters
span: TheSpancovering this nodeid: The identifier (name) of the interface.type_parameters: Type parameters that get bound to the interface.extends: Other interfaces/types this interface extends.bodydeclare:truefordeclare interface Foo {}
Sourcepub fn boxed(
span: Span,
id: BindingIdentifier<'a>,
type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>,
body: Box<'a, TSInterfaceBody<'a>>,
declare: bool,
builder: &impl GetAstBuilder<'a>,
) -> Box<'a, TSInterfaceDeclaration<'a>>
pub fn boxed( span: Span, id: BindingIdentifier<'a>, type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>, extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>, body: Box<'a, TSInterfaceBody<'a>>, declare: bool, builder: &impl GetAstBuilder<'a>, ) -> Box<'a, TSInterfaceDeclaration<'a>>
Build a TSInterfaceDeclaration, and store it in the memory arena.
Returns a Box containing the newly-allocated node.
If you want a stack-allocated node, use TSInterfaceDeclaration::new instead.
§Parameters
span: TheSpancovering this nodeid: The identifier (name) of the interface.type_parameters: Type parameters that get bound to the interface.extends: Other interfaces/types this interface extends.bodydeclare:truefordeclare interface Foo {}
Sourcepub fn new_with_scope_id(
span: Span,
id: BindingIdentifier<'a>,
type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>,
body: Box<'a, TSInterfaceBody<'a>>,
declare: bool,
scope_id: ScopeId,
builder: &impl GetAstBuilder<'a>,
) -> TSInterfaceDeclaration<'a>
pub fn new_with_scope_id( span: Span, id: BindingIdentifier<'a>, type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>, extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>, body: Box<'a, TSInterfaceBody<'a>>, declare: bool, scope_id: ScopeId, builder: &impl GetAstBuilder<'a>, ) -> TSInterfaceDeclaration<'a>
Build a TSInterfaceDeclaration with scope_id.
If you want the built node to be allocated in the memory arena,
use TSInterfaceDeclaration::boxed_with_scope_id instead.
§Parameters
span: TheSpancovering this nodeid: The identifier (name) of the interface.type_parameters: Type parameters that get bound to the interface.extends: Other interfaces/types this interface extends.bodydeclare:truefordeclare interface Foo {}scope_id
Sourcepub fn boxed_with_scope_id(
span: Span,
id: BindingIdentifier<'a>,
type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>,
extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>,
body: Box<'a, TSInterfaceBody<'a>>,
declare: bool,
scope_id: ScopeId,
builder: &impl GetAstBuilder<'a>,
) -> Box<'a, TSInterfaceDeclaration<'a>>
pub fn boxed_with_scope_id( span: Span, id: BindingIdentifier<'a>, type_parameters: Option<Box<'a, TSTypeParameterDeclaration<'a>>>, extends: impl IntoIn<'a, Vec<'a, TSInterfaceHeritage<'a>>>, body: Box<'a, TSInterfaceBody<'a>>, declare: bool, scope_id: ScopeId, builder: &impl GetAstBuilder<'a>, ) -> Box<'a, TSInterfaceDeclaration<'a>>
Build a TSInterfaceDeclaration with scope_id, and store it in the memory arena.
Returns a Box containing the newly-allocated node.
If you want a stack-allocated node, use TSInterfaceDeclaration::new_with_scope_id instead.
§Parameters
span: TheSpancovering this nodeid: The identifier (name) of the interface.type_parameters: Type parameters that get bound to the interface.extends: Other interfaces/types this interface extends.bodydeclare:truefordeclare interface Foo {}scope_id
Source§impl TSInterfaceDeclaration<'_>
impl TSInterfaceDeclaration<'_>
Sourcepub fn node_id(&self) -> NodeId
pub fn node_id(&self) -> NodeId
Get NodeId of TSInterfaceDeclaration.
Only use this method on a post-semantic AST where NodeIds are always defined.
Sourcepub fn set_node_id(&self, node_id: NodeId)
pub fn set_node_id(&self, node_id: NodeId)
Set NodeId of TSInterfaceDeclaration.
Sourcepub fn scope_id(&self) -> ScopeId
pub fn scope_id(&self) -> ScopeId
Get ScopeId of TSInterfaceDeclaration.
Only use this method on a post-semantic AST where ScopeIds are always defined.
§Panics
Panics if scope_id is None.
Sourcepub fn set_scope_id(&self, scope_id: ScopeId)
pub fn set_scope_id(&self, scope_id: ScopeId)
Set ScopeId of TSInterfaceDeclaration.
Trait Implementations§
Source§impl<'new_alloc> CloneIn<'new_alloc> for TSInterfaceDeclaration<'_>
impl<'new_alloc> CloneIn<'new_alloc> for TSInterfaceDeclaration<'_>
Source§type Cloned = TSInterfaceDeclaration<'new_alloc>
type Cloned = TSInterfaceDeclaration<'new_alloc>
Source§fn clone_in_impl(
&self,
with_semantic_ids: CloneInSemanticIds,
allocator: &'new_alloc Allocator,
) -> <TSInterfaceDeclaration<'_> as CloneIn<'new_alloc>>::Cloned
fn clone_in_impl( &self, with_semantic_ids: CloneInSemanticIds, allocator: &'new_alloc Allocator, ) -> <TSInterfaceDeclaration<'_> as CloneIn<'new_alloc>>::Cloned
self into allocator, threading whether semantic ids should be preserved as a
runtime with_semantic_ids flag rather than as two separate methods. Read moreSource§fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned
fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned
self into the given allocator. allocator may be the same one
that self is already in.Source§fn clone_in_with_semantic_ids(
&self,
allocator: &'new_alloc Allocator,
) -> Self::Cloned
fn clone_in_with_semantic_ids( &self, allocator: &'new_alloc Allocator, ) -> Self::Cloned
clone_in, but for some special type, it will also clone the semantic ids.
Please use this method only if you make sure semantic info is synced with the ast node.Source§impl ContentEq for TSInterfaceDeclaration<'_>
impl ContentEq for TSInterfaceDeclaration<'_>
Source§fn content_eq(&self, other: &TSInterfaceDeclaration<'_>) -> bool
fn content_eq(&self, other: &TSInterfaceDeclaration<'_>) -> bool
self and other to be equal.Source§fn content_ne(&self, other: &Self) -> bool
fn content_ne(&self, other: &Self) -> bool
self and other not to be equal.
The default implementation is almost always
sufficient, and should not be overridden without very good reason.Source§impl<'a> Debug for TSInterfaceDeclaration<'a>
impl<'a> Debug for TSInterfaceDeclaration<'a>
Source§impl<'a> Dummy<'a> for TSInterfaceDeclaration<'a>
impl<'a> Dummy<'a> for TSInterfaceDeclaration<'a>
Source§fn dummy(allocator: &'a Allocator) -> TSInterfaceDeclaration<'a>
fn dummy(allocator: &'a Allocator) -> TSInterfaceDeclaration<'a>
Create a dummy TSInterfaceDeclaration.
Has cost of making 1 allocation (40 bytes).
Source§impl Gen for TSInterfaceDeclaration<'_>
impl Gen for TSInterfaceDeclaration<'_>
Source§impl GetNodeId for TSInterfaceDeclaration<'_>
impl GetNodeId for TSInterfaceDeclaration<'_>
Source§impl GetSpan for TSInterfaceDeclaration<'_>
impl GetSpan for TSInterfaceDeclaration<'_>
Source§impl GetSpanMut for TSInterfaceDeclaration<'_>
impl GetSpanMut for TSInterfaceDeclaration<'_>
Source§impl<'a> ReplaceWith<'a> for TSInterfaceDeclaration<'a>
impl<'a> ReplaceWith<'a> for TSInterfaceDeclaration<'a>
Source§fn replace_with(&mut self, replacer: impl FnOnce(Self) -> Self)
fn replace_with(&mut self, replacer: impl FnOnce(Self) -> Self)
replacer. Read moreSource§impl<'a> TakeIn<'a> for TSInterfaceDeclaration<'a>
impl<'a> TakeIn<'a> for TSInterfaceDeclaration<'a>
Source§fn take_in(&mut self, allocator_accessor: &impl GetAllocator<'a>) -> Self
fn take_in(&mut self, allocator_accessor: &impl GetAllocator<'a>) -> Self
Source§fn take_in_box(
&mut self,
allocator_accessor: &impl GetAllocator<'a>,
) -> Box<'a, Self>
fn take_in_box( &mut self, allocator_accessor: &impl GetAllocator<'a>, ) -> Box<'a, Self>
Source§impl UnstableAddress for TSInterfaceDeclaration<'_>
impl UnstableAddress for TSInterfaceDeclaration<'_>
Auto Trait Implementations§
impl<'a> !Freeze for TSInterfaceDeclaration<'a>
impl<'a> !RefUnwindSafe for TSInterfaceDeclaration<'a>
impl<'a> !Send for TSInterfaceDeclaration<'a>
impl<'a> !Sync for TSInterfaceDeclaration<'a>
impl<'a> !UnwindSafe for TSInterfaceDeclaration<'a>
impl<'a> Forget for TSInterfaceDeclaration<'a>
impl<'a> Move for TSInterfaceDeclaration<'a>
impl<'a> Unpin for TSInterfaceDeclaration<'a>
impl<'a> UnsafeUnpin for TSInterfaceDeclaration<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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