Skip to main content

NodePtr

Struct NodePtr 

Source
pub struct NodePtr<'gc>(pub &'gc Node<'gc>);
Expand description

A wrapper around Node&, with “shallow” hashing and equality, suitable for hash tables.

Tuple Fields§

§0: &'gc Node<'gc>

Implementations§

Source§

impl<'gc> NodePtr<'gc>

Source

pub fn from_node(node: &'gc Node<'gc>) -> Self

Wrap a node reference so it can be used as a hash-table key.

Methods from Deref<Target = Node<'gc>>§

Source

pub fn kind(&self) -> NodeKind

This node’s NodeKind.

Source

pub fn metadata(&self) -> &NodeMetadata<'gc>

This node’s metadata, common to every kind.

Source

pub fn node_id(&self) -> NodeId

This node’s arena identity (see NodeId).

Source

pub fn range(&self) -> SMRange

This node’s source range.

Source

pub fn is_function_like(&self) -> bool

Whether this node’s kind is in the FunctionLike range.

Source

pub fn is_statement(&self) -> bool

Whether this node’s kind is in the Statement range.

Source

pub fn is_loop_statement(&self) -> bool

Whether this node’s kind is in the LoopStatement range.

Source

pub fn is_call_expression_like(&self) -> bool

Whether this node’s kind is in the CallExpressionLike range.

Source

pub fn is_member_expression_like(&self) -> bool

Whether this node’s kind is in the MemberExpressionLike range.

Source

pub fn is_class_like(&self) -> bool

Whether this node’s kind is in the ClassLike range.

Source

pub fn is_pattern(&self) -> bool

Whether this node’s kind is in the Pattern range.

Source

pub fn is_match_pattern(&self) -> bool

Whether this node’s kind is in the MatchPattern range.

Source

pub fn is_jsx(&self) -> bool

Whether this node’s kind is in the JSX range.

Source

pub fn is_flow(&self) -> bool

Whether this node’s kind is in the Flow range.

Source

pub fn is_ts(&self) -> bool

Whether this node’s kind is in the TS range.

Source

pub fn is_cover(&self) -> bool

Whether this node’s kind is in the Cover range.

Source

pub fn as_empty(&self) -> Option<&Empty<'gc>>

The payload if this is a Empty, None otherwise.

Source

pub fn as_metadata(&self) -> Option<&Metadata<'gc>>

The payload if this is a Metadata, None otherwise.

Source

pub fn as_program(&self) -> Option<&Program<'gc>>

The payload if this is a Program, None otherwise.

Source

pub fn as_function_expression(&self) -> Option<&FunctionExpression<'gc>>

The payload if this is a FunctionExpression, None otherwise.

Source

pub fn as_arrow_function_expression( &self, ) -> Option<&ArrowFunctionExpression<'gc>>

The payload if this is a ArrowFunctionExpression, None otherwise.

Source

pub fn as_function_declaration(&self) -> Option<&FunctionDeclaration<'gc>>

The payload if this is a FunctionDeclaration, None otherwise.

Source

pub fn as_component_declaration(&self) -> Option<&ComponentDeclaration<'gc>>

The payload if this is a ComponentDeclaration, None otherwise.

Source

pub fn as_hook_declaration(&self) -> Option<&HookDeclaration<'gc>>

The payload if this is a HookDeclaration, None otherwise.

Source

pub fn as_match_statement(&self) -> Option<&MatchStatement<'gc>>

The payload if this is a MatchStatement, None otherwise.

Source

pub fn as_while_statement(&self) -> Option<&WhileStatement<'gc>>

The payload if this is a WhileStatement, None otherwise.

Source

pub fn as_do_while_statement(&self) -> Option<&DoWhileStatement<'gc>>

The payload if this is a DoWhileStatement, None otherwise.

Source

pub fn as_for_in_statement(&self) -> Option<&ForInStatement<'gc>>

The payload if this is a ForInStatement, None otherwise.

Source

pub fn as_for_of_statement(&self) -> Option<&ForOfStatement<'gc>>

The payload if this is a ForOfStatement, None otherwise.

Source

pub fn as_for_statement(&self) -> Option<&ForStatement<'gc>>

The payload if this is a ForStatement, None otherwise.

Source

pub fn as_debugger_statement(&self) -> Option<&DebuggerStatement<'gc>>

The payload if this is a DebuggerStatement, None otherwise.

Source

pub fn as_empty_statement(&self) -> Option<&EmptyStatement<'gc>>

The payload if this is a EmptyStatement, None otherwise.

Source

pub fn as_block_statement(&self) -> Option<&BlockStatement<'gc>>

The payload if this is a BlockStatement, None otherwise.

Source

pub fn as_static_block(&self) -> Option<&StaticBlock<'gc>>

The payload if this is a StaticBlock, None otherwise.

Source

pub fn as_break_statement(&self) -> Option<&BreakStatement<'gc>>

The payload if this is a BreakStatement, None otherwise.

Source

pub fn as_continue_statement(&self) -> Option<&ContinueStatement<'gc>>

The payload if this is a ContinueStatement, None otherwise.

Source

pub fn as_throw_statement(&self) -> Option<&ThrowStatement<'gc>>

The payload if this is a ThrowStatement, None otherwise.

Source

pub fn as_return_statement(&self) -> Option<&ReturnStatement<'gc>>

The payload if this is a ReturnStatement, None otherwise.

Source

pub fn as_with_statement(&self) -> Option<&WithStatement<'gc>>

The payload if this is a WithStatement, None otherwise.

Source

pub fn as_switch_statement(&self) -> Option<&SwitchStatement<'gc>>

The payload if this is a SwitchStatement, None otherwise.

Source

pub fn as_labeled_statement(&self) -> Option<&LabeledStatement<'gc>>

The payload if this is a LabeledStatement, None otherwise.

Source

pub fn as_expression_statement(&self) -> Option<&ExpressionStatement<'gc>>

The payload if this is a ExpressionStatement, None otherwise.

Source

pub fn as_try_statement(&self) -> Option<&TryStatement<'gc>>

The payload if this is a TryStatement, None otherwise.

Source

pub fn as_if_statement(&self) -> Option<&IfStatement<'gc>>

The payload if this is a IfStatement, None otherwise.

Source

pub fn as_null_literal(&self) -> Option<&NullLiteral<'gc>>

The payload if this is a NullLiteral, None otherwise.

Source

pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral<'gc>>

The payload if this is a BooleanLiteral, None otherwise.

Source

pub fn as_string_literal(&self) -> Option<&StringLiteral<'gc>>

The payload if this is a StringLiteral, None otherwise.

Source

pub fn as_numeric_literal(&self) -> Option<&NumericLiteral<'gc>>

The payload if this is a NumericLiteral, None otherwise.

Source

pub fn as_reg_exp_literal(&self) -> Option<&RegExpLiteral<'gc>>

The payload if this is a RegExpLiteral, None otherwise.

Source

pub fn as_big_int_literal(&self) -> Option<&BigIntLiteral<'gc>>

The payload if this is a BigIntLiteral, None otherwise.

Source

pub fn as_this_expression(&self) -> Option<&ThisExpression<'gc>>

The payload if this is a ThisExpression, None otherwise.

Source

pub fn as_super(&self) -> Option<&Super<'gc>>

The payload if this is a Super, None otherwise.

Source

pub fn as_sequence_expression(&self) -> Option<&SequenceExpression<'gc>>

The payload if this is a SequenceExpression, None otherwise.

Source

pub fn as_object_expression(&self) -> Option<&ObjectExpression<'gc>>

The payload if this is a ObjectExpression, None otherwise.

Source

pub fn as_array_expression(&self) -> Option<&ArrayExpression<'gc>>

The payload if this is a ArrayExpression, None otherwise.

Source

pub fn as_spread_element(&self) -> Option<&SpreadElement<'gc>>

The payload if this is a SpreadElement, None otherwise.

Source

pub fn as_new_expression(&self) -> Option<&NewExpression<'gc>>

The payload if this is a NewExpression, None otherwise.

Source

pub fn as_yield_expression(&self) -> Option<&YieldExpression<'gc>>

The payload if this is a YieldExpression, None otherwise.

Source

pub fn as_await_expression(&self) -> Option<&AwaitExpression<'gc>>

The payload if this is a AwaitExpression, None otherwise.

Source

pub fn as_import_expression(&self) -> Option<&ImportExpression<'gc>>

The payload if this is a ImportExpression, None otherwise.

Source

pub fn as_call_expression(&self) -> Option<&CallExpression<'gc>>

The payload if this is a CallExpression, None otherwise.

Source

pub fn as_optional_call_expression( &self, ) -> Option<&OptionalCallExpression<'gc>>

The payload if this is a OptionalCallExpression, None otherwise.

Source

pub fn as_assignment_expression(&self) -> Option<&AssignmentExpression<'gc>>

The payload if this is a AssignmentExpression, None otherwise.

Source

pub fn as_unary_expression(&self) -> Option<&UnaryExpression<'gc>>

The payload if this is a UnaryExpression, None otherwise.

Source

pub fn as_update_expression(&self) -> Option<&UpdateExpression<'gc>>

The payload if this is a UpdateExpression, None otherwise.

Source

pub fn as_member_expression(&self) -> Option<&MemberExpression<'gc>>

The payload if this is a MemberExpression, None otherwise.

Source

pub fn as_optional_member_expression( &self, ) -> Option<&OptionalMemberExpression<'gc>>

The payload if this is a OptionalMemberExpression, None otherwise.

Source

pub fn as_logical_expression(&self) -> Option<&LogicalExpression<'gc>>

The payload if this is a LogicalExpression, None otherwise.

Source

pub fn as_conditional_expression(&self) -> Option<&ConditionalExpression<'gc>>

The payload if this is a ConditionalExpression, None otherwise.

Source

pub fn as_binary_expression(&self) -> Option<&BinaryExpression<'gc>>

The payload if this is a BinaryExpression, None otherwise.

Source

pub fn as_directive(&self) -> Option<&Directive<'gc>>

The payload if this is a Directive, None otherwise.

Source

pub fn as_directive_literal(&self) -> Option<&DirectiveLiteral<'gc>>

The payload if this is a DirectiveLiteral, None otherwise.

Source

pub fn as_identifier(&self) -> Option<&Identifier<'gc>>

The payload if this is a Identifier, None otherwise.

Source

pub fn as_private_name(&self) -> Option<&PrivateName<'gc>>

The payload if this is a PrivateName, None otherwise.

Source

pub fn as_meta_property(&self) -> Option<&MetaProperty<'gc>>

The payload if this is a MetaProperty, None otherwise.

Source

pub fn as_switch_case(&self) -> Option<&SwitchCase<'gc>>

The payload if this is a SwitchCase, None otherwise.

Source

pub fn as_catch_clause(&self) -> Option<&CatchClause<'gc>>

The payload if this is a CatchClause, None otherwise.

Source

pub fn as_variable_declarator(&self) -> Option<&VariableDeclarator<'gc>>

The payload if this is a VariableDeclarator, None otherwise.

Source

pub fn as_variable_declaration(&self) -> Option<&VariableDeclaration<'gc>>

The payload if this is a VariableDeclaration, None otherwise.

Source

pub fn as_template_literal(&self) -> Option<&TemplateLiteral<'gc>>

The payload if this is a TemplateLiteral, None otherwise.

Source

pub fn as_tagged_template_expression( &self, ) -> Option<&TaggedTemplateExpression<'gc>>

The payload if this is a TaggedTemplateExpression, None otherwise.

Source

pub fn as_template_element(&self) -> Option<&TemplateElement<'gc>>

The payload if this is a TemplateElement, None otherwise.

Source

pub fn as_property(&self) -> Option<&Property<'gc>>

The payload if this is a Property, None otherwise.

Source

pub fn as_decorator(&self) -> Option<&Decorator<'gc>>

The payload if this is a Decorator, None otherwise.

Source

pub fn as_class_declaration(&self) -> Option<&ClassDeclaration<'gc>>

The payload if this is a ClassDeclaration, None otherwise.

Source

pub fn as_class_expression(&self) -> Option<&ClassExpression<'gc>>

The payload if this is a ClassExpression, None otherwise.

Source

pub fn as_class_body(&self) -> Option<&ClassBody<'gc>>

The payload if this is a ClassBody, None otherwise.

Source

pub fn as_class_property(&self) -> Option<&ClassProperty<'gc>>

The payload if this is a ClassProperty, None otherwise.

Source

pub fn as_class_private_property(&self) -> Option<&ClassPrivateProperty<'gc>>

The payload if this is a ClassPrivateProperty, None otherwise.

Source

pub fn as_method_definition(&self) -> Option<&MethodDefinition<'gc>>

The payload if this is a MethodDefinition, None otherwise.

Source

pub fn as_import_declaration(&self) -> Option<&ImportDeclaration<'gc>>

The payload if this is a ImportDeclaration, None otherwise.

Source

pub fn as_import_specifier(&self) -> Option<&ImportSpecifier<'gc>>

The payload if this is a ImportSpecifier, None otherwise.

Source

pub fn as_import_default_specifier( &self, ) -> Option<&ImportDefaultSpecifier<'gc>>

The payload if this is a ImportDefaultSpecifier, None otherwise.

Source

pub fn as_import_namespace_specifier( &self, ) -> Option<&ImportNamespaceSpecifier<'gc>>

The payload if this is a ImportNamespaceSpecifier, None otherwise.

Source

pub fn as_import_attribute(&self) -> Option<&ImportAttribute<'gc>>

The payload if this is a ImportAttribute, None otherwise.

Source

pub fn as_export_named_declaration( &self, ) -> Option<&ExportNamedDeclaration<'gc>>

The payload if this is a ExportNamedDeclaration, None otherwise.

Source

pub fn as_export_specifier(&self) -> Option<&ExportSpecifier<'gc>>

The payload if this is a ExportSpecifier, None otherwise.

Source

pub fn as_export_namespace_specifier( &self, ) -> Option<&ExportNamespaceSpecifier<'gc>>

The payload if this is a ExportNamespaceSpecifier, None otherwise.

Source

pub fn as_export_default_declaration( &self, ) -> Option<&ExportDefaultDeclaration<'gc>>

The payload if this is a ExportDefaultDeclaration, None otherwise.

Source

pub fn as_export_all_declaration(&self) -> Option<&ExportAllDeclaration<'gc>>

The payload if this is a ExportAllDeclaration, None otherwise.

Source

pub fn as_object_pattern(&self) -> Option<&ObjectPattern<'gc>>

The payload if this is a ObjectPattern, None otherwise.

Source

pub fn as_array_pattern(&self) -> Option<&ArrayPattern<'gc>>

The payload if this is a ArrayPattern, None otherwise.

Source

pub fn as_rest_element(&self) -> Option<&RestElement<'gc>>

The payload if this is a RestElement, None otherwise.

Source

pub fn as_assignment_pattern(&self) -> Option<&AssignmentPattern<'gc>>

The payload if this is a AssignmentPattern, None otherwise.

Source

pub fn as_match_statement_case(&self) -> Option<&MatchStatementCase<'gc>>

The payload if this is a MatchStatementCase, None otherwise.

Source

pub fn as_match_expression(&self) -> Option<&MatchExpression<'gc>>

The payload if this is a MatchExpression, None otherwise.

Source

pub fn as_match_expression_case(&self) -> Option<&MatchExpressionCase<'gc>>

The payload if this is a MatchExpressionCase, None otherwise.

Source

pub fn as_match_wildcard_pattern(&self) -> Option<&MatchWildcardPattern<'gc>>

The payload if this is a MatchWildcardPattern, None otherwise.

Source

pub fn as_match_literal_pattern(&self) -> Option<&MatchLiteralPattern<'gc>>

The payload if this is a MatchLiteralPattern, None otherwise.

Source

pub fn as_match_unary_pattern(&self) -> Option<&MatchUnaryPattern<'gc>>

The payload if this is a MatchUnaryPattern, None otherwise.

Source

pub fn as_match_identifier_pattern( &self, ) -> Option<&MatchIdentifierPattern<'gc>>

The payload if this is a MatchIdentifierPattern, None otherwise.

Source

pub fn as_match_binding_pattern(&self) -> Option<&MatchBindingPattern<'gc>>

The payload if this is a MatchBindingPattern, None otherwise.

Source

pub fn as_match_object_pattern(&self) -> Option<&MatchObjectPattern<'gc>>

The payload if this is a MatchObjectPattern, None otherwise.

Source

pub fn as_match_array_pattern(&self) -> Option<&MatchArrayPattern<'gc>>

The payload if this is a MatchArrayPattern, None otherwise.

Source

pub fn as_match_or_pattern(&self) -> Option<&MatchOrPattern<'gc>>

The payload if this is a MatchOrPattern, None otherwise.

Source

pub fn as_match_as_pattern(&self) -> Option<&MatchAsPattern<'gc>>

The payload if this is a MatchAsPattern, None otherwise.

Source

pub fn as_match_member_pattern(&self) -> Option<&MatchMemberPattern<'gc>>

The payload if this is a MatchMemberPattern, None otherwise.

Source

pub fn as_match_instance_pattern(&self) -> Option<&MatchInstancePattern<'gc>>

The payload if this is a MatchInstancePattern, None otherwise.

Source

pub fn as_match_object_pattern_property( &self, ) -> Option<&MatchObjectPatternProperty<'gc>>

The payload if this is a MatchObjectPatternProperty, None otherwise.

Source

pub fn as_match_instance_object_pattern( &self, ) -> Option<&MatchInstanceObjectPattern<'gc>>

The payload if this is a MatchInstanceObjectPattern, None otherwise.

Source

pub fn as_match_rest_pattern(&self) -> Option<&MatchRestPattern<'gc>>

The payload if this is a MatchRestPattern, None otherwise.

Source

pub fn as_jsx_identifier(&self) -> Option<&JSXIdentifier<'gc>>

The payload if this is a JSXIdentifier, None otherwise.

Source

pub fn as_jsx_member_expression(&self) -> Option<&JSXMemberExpression<'gc>>

The payload if this is a JSXMemberExpression, None otherwise.

Source

pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName<'gc>>

The payload if this is a JSXNamespacedName, None otherwise.

Source

pub fn as_jsx_empty_expression(&self) -> Option<&JSXEmptyExpression<'gc>>

The payload if this is a JSXEmptyExpression, None otherwise.

Source

pub fn as_jsx_expression_container( &self, ) -> Option<&JSXExpressionContainer<'gc>>

The payload if this is a JSXExpressionContainer, None otherwise.

Source

pub fn as_jsx_spread_child(&self) -> Option<&JSXSpreadChild<'gc>>

The payload if this is a JSXSpreadChild, None otherwise.

Source

pub fn as_jsx_opening_element(&self) -> Option<&JSXOpeningElement<'gc>>

The payload if this is a JSXOpeningElement, None otherwise.

Source

pub fn as_jsx_closing_element(&self) -> Option<&JSXClosingElement<'gc>>

The payload if this is a JSXClosingElement, None otherwise.

Source

pub fn as_jsx_attribute(&self) -> Option<&JSXAttribute<'gc>>

The payload if this is a JSXAttribute, None otherwise.

Source

pub fn as_jsx_spread_attribute(&self) -> Option<&JSXSpreadAttribute<'gc>>

The payload if this is a JSXSpreadAttribute, None otherwise.

Source

pub fn as_jsx_string_literal(&self) -> Option<&JSXStringLiteral<'gc>>

The payload if this is a JSXStringLiteral, None otherwise.

Source

pub fn as_jsx_text(&self) -> Option<&JSXText<'gc>>

The payload if this is a JSXText, None otherwise.

Source

pub fn as_jsx_element(&self) -> Option<&JSXElement<'gc>>

The payload if this is a JSXElement, None otherwise.

Source

pub fn as_jsx_fragment(&self) -> Option<&JSXFragment<'gc>>

The payload if this is a JSXFragment, None otherwise.

Source

pub fn as_jsx_opening_fragment(&self) -> Option<&JSXOpeningFragment<'gc>>

The payload if this is a JSXOpeningFragment, None otherwise.

Source

pub fn as_jsx_closing_fragment(&self) -> Option<&JSXClosingFragment<'gc>>

The payload if this is a JSXClosingFragment, None otherwise.

Source

pub fn as_exists_type_annotation(&self) -> Option<&ExistsTypeAnnotation<'gc>>

The payload if this is a ExistsTypeAnnotation, None otherwise.

Source

pub fn as_empty_type_annotation(&self) -> Option<&EmptyTypeAnnotation<'gc>>

The payload if this is a EmptyTypeAnnotation, None otherwise.

Source

pub fn as_string_type_annotation(&self) -> Option<&StringTypeAnnotation<'gc>>

The payload if this is a StringTypeAnnotation, None otherwise.

Source

pub fn as_number_type_annotation(&self) -> Option<&NumberTypeAnnotation<'gc>>

The payload if this is a NumberTypeAnnotation, None otherwise.

Source

pub fn as_string_literal_type_annotation( &self, ) -> Option<&StringLiteralTypeAnnotation<'gc>>

The payload if this is a StringLiteralTypeAnnotation, None otherwise.

Source

pub fn as_number_literal_type_annotation( &self, ) -> Option<&NumberLiteralTypeAnnotation<'gc>>

The payload if this is a NumberLiteralTypeAnnotation, None otherwise.

Source

pub fn as_big_int_literal_type_annotation( &self, ) -> Option<&BigIntLiteralTypeAnnotation<'gc>>

The payload if this is a BigIntLiteralTypeAnnotation, None otherwise.

Source

pub fn as_boolean_type_annotation(&self) -> Option<&BooleanTypeAnnotation<'gc>>

The payload if this is a BooleanTypeAnnotation, None otherwise.

Source

pub fn as_boolean_literal_type_annotation( &self, ) -> Option<&BooleanLiteralTypeAnnotation<'gc>>

The payload if this is a BooleanLiteralTypeAnnotation, None otherwise.

Source

pub fn as_null_literal_type_annotation( &self, ) -> Option<&NullLiteralTypeAnnotation<'gc>>

The payload if this is a NullLiteralTypeAnnotation, None otherwise.

Source

pub fn as_symbol_type_annotation(&self) -> Option<&SymbolTypeAnnotation<'gc>>

The payload if this is a SymbolTypeAnnotation, None otherwise.

Source

pub fn as_any_type_annotation(&self) -> Option<&AnyTypeAnnotation<'gc>>

The payload if this is a AnyTypeAnnotation, None otherwise.

Source

pub fn as_mixed_type_annotation(&self) -> Option<&MixedTypeAnnotation<'gc>>

The payload if this is a MixedTypeAnnotation, None otherwise.

Source

pub fn as_big_int_type_annotation(&self) -> Option<&BigIntTypeAnnotation<'gc>>

The payload if this is a BigIntTypeAnnotation, None otherwise.

Source

pub fn as_void_type_annotation(&self) -> Option<&VoidTypeAnnotation<'gc>>

The payload if this is a VoidTypeAnnotation, None otherwise.

Source

pub fn as_never_type_annotation(&self) -> Option<&NeverTypeAnnotation<'gc>>

The payload if this is a NeverTypeAnnotation, None otherwise.

Source

pub fn as_unknown_type_annotation(&self) -> Option<&UnknownTypeAnnotation<'gc>>

The payload if this is a UnknownTypeAnnotation, None otherwise.

Source

pub fn as_undefined_type_annotation( &self, ) -> Option<&UndefinedTypeAnnotation<'gc>>

The payload if this is a UndefinedTypeAnnotation, None otherwise.

Source

pub fn as_function_type_annotation( &self, ) -> Option<&FunctionTypeAnnotation<'gc>>

The payload if this is a FunctionTypeAnnotation, None otherwise.

Source

pub fn as_hook_type_annotation(&self) -> Option<&HookTypeAnnotation<'gc>>

The payload if this is a HookTypeAnnotation, None otherwise.

Source

pub fn as_function_type_param(&self) -> Option<&FunctionTypeParam<'gc>>

The payload if this is a FunctionTypeParam, None otherwise.

Source

pub fn as_component_type_annotation( &self, ) -> Option<&ComponentTypeAnnotation<'gc>>

The payload if this is a ComponentTypeAnnotation, None otherwise.

Source

pub fn as_component_type_parameter( &self, ) -> Option<&ComponentTypeParameter<'gc>>

The payload if this is a ComponentTypeParameter, None otherwise.

Source

pub fn as_nullable_type_annotation( &self, ) -> Option<&NullableTypeAnnotation<'gc>>

The payload if this is a NullableTypeAnnotation, None otherwise.

Source

pub fn as_qualified_type_identifier( &self, ) -> Option<&QualifiedTypeIdentifier<'gc>>

The payload if this is a QualifiedTypeIdentifier, None otherwise.

Source

pub fn as_typeof_type_annotation(&self) -> Option<&TypeofTypeAnnotation<'gc>>

The payload if this is a TypeofTypeAnnotation, None otherwise.

Source

pub fn as_keyof_type_annotation(&self) -> Option<&KeyofTypeAnnotation<'gc>>

The payload if this is a KeyofTypeAnnotation, None otherwise.

Source

pub fn as_type_operator(&self) -> Option<&TypeOperator<'gc>>

The payload if this is a TypeOperator, None otherwise.

Source

pub fn as_qualified_typeof_identifier( &self, ) -> Option<&QualifiedTypeofIdentifier<'gc>>

The payload if this is a QualifiedTypeofIdentifier, None otherwise.

Source

pub fn as_tuple_type_annotation(&self) -> Option<&TupleTypeAnnotation<'gc>>

The payload if this is a TupleTypeAnnotation, None otherwise.

Source

pub fn as_tuple_type_spread_element( &self, ) -> Option<&TupleTypeSpreadElement<'gc>>

The payload if this is a TupleTypeSpreadElement, None otherwise.

Source

pub fn as_tuple_type_labeled_element( &self, ) -> Option<&TupleTypeLabeledElement<'gc>>

The payload if this is a TupleTypeLabeledElement, None otherwise.

Source

pub fn as_array_type_annotation(&self) -> Option<&ArrayTypeAnnotation<'gc>>

The payload if this is a ArrayTypeAnnotation, None otherwise.

Source

pub fn as_infer_type_annotation(&self) -> Option<&InferTypeAnnotation<'gc>>

The payload if this is a InferTypeAnnotation, None otherwise.

Source

pub fn as_union_type_annotation(&self) -> Option<&UnionTypeAnnotation<'gc>>

The payload if this is a UnionTypeAnnotation, None otherwise.

Source

pub fn as_intersection_type_annotation( &self, ) -> Option<&IntersectionTypeAnnotation<'gc>>

The payload if this is a IntersectionTypeAnnotation, None otherwise.

Source

pub fn as_generic_type_annotation(&self) -> Option<&GenericTypeAnnotation<'gc>>

The payload if this is a GenericTypeAnnotation, None otherwise.

Source

pub fn as_indexed_access_type(&self) -> Option<&IndexedAccessType<'gc>>

The payload if this is a IndexedAccessType, None otherwise.

Source

pub fn as_optional_indexed_access_type( &self, ) -> Option<&OptionalIndexedAccessType<'gc>>

The payload if this is a OptionalIndexedAccessType, None otherwise.

Source

pub fn as_conditional_type_annotation( &self, ) -> Option<&ConditionalTypeAnnotation<'gc>>

The payload if this is a ConditionalTypeAnnotation, None otherwise.

Source

pub fn as_type_predicate(&self) -> Option<&TypePredicate<'gc>>

The payload if this is a TypePredicate, None otherwise.

Source

pub fn as_interface_type_annotation( &self, ) -> Option<&InterfaceTypeAnnotation<'gc>>

The payload if this is a InterfaceTypeAnnotation, None otherwise.

Source

pub fn as_type_alias(&self) -> Option<&TypeAlias<'gc>>

The payload if this is a TypeAlias, None otherwise.

Source

pub fn as_opaque_type(&self) -> Option<&OpaqueType<'gc>>

The payload if this is a OpaqueType, None otherwise.

Source

pub fn as_interface_declaration(&self) -> Option<&InterfaceDeclaration<'gc>>

The payload if this is a InterfaceDeclaration, None otherwise.

Source

pub fn as_declare_type_alias(&self) -> Option<&DeclareTypeAlias<'gc>>

The payload if this is a DeclareTypeAlias, None otherwise.

Source

pub fn as_declare_opaque_type(&self) -> Option<&DeclareOpaqueType<'gc>>

The payload if this is a DeclareOpaqueType, None otherwise.

Source

pub fn as_declare_interface(&self) -> Option<&DeclareInterface<'gc>>

The payload if this is a DeclareInterface, None otherwise.

Source

pub fn as_declare_class(&self) -> Option<&DeclareClass<'gc>>

The payload if this is a DeclareClass, None otherwise.

Source

pub fn as_declare_function(&self) -> Option<&DeclareFunction<'gc>>

The payload if this is a DeclareFunction, None otherwise.

Source

pub fn as_declare_hook(&self) -> Option<&DeclareHook<'gc>>

The payload if this is a DeclareHook, None otherwise.

Source

pub fn as_declare_component(&self) -> Option<&DeclareComponent<'gc>>

The payload if this is a DeclareComponent, None otherwise.

Source

pub fn as_declare_variable(&self) -> Option<&DeclareVariable<'gc>>

The payload if this is a DeclareVariable, None otherwise.

Source

pub fn as_declare_enum(&self) -> Option<&DeclareEnum<'gc>>

The payload if this is a DeclareEnum, None otherwise.

Source

pub fn as_declare_export_declaration( &self, ) -> Option<&DeclareExportDeclaration<'gc>>

The payload if this is a DeclareExportDeclaration, None otherwise.

Source

pub fn as_declare_export_all_declaration( &self, ) -> Option<&DeclareExportAllDeclaration<'gc>>

The payload if this is a DeclareExportAllDeclaration, None otherwise.

Source

pub fn as_declare_module(&self) -> Option<&DeclareModule<'gc>>

The payload if this is a DeclareModule, None otherwise.

Source

pub fn as_declare_namespace(&self) -> Option<&DeclareNamespace<'gc>>

The payload if this is a DeclareNamespace, None otherwise.

Source

pub fn as_declare_module_exports(&self) -> Option<&DeclareModuleExports<'gc>>

The payload if this is a DeclareModuleExports, None otherwise.

Source

pub fn as_interface_extends(&self) -> Option<&InterfaceExtends<'gc>>

The payload if this is a InterfaceExtends, None otherwise.

Source

pub fn as_class_implements(&self) -> Option<&ClassImplements<'gc>>

The payload if this is a ClassImplements, None otherwise.

Source

pub fn as_type_annotation(&self) -> Option<&TypeAnnotation<'gc>>

The payload if this is a TypeAnnotation, None otherwise.

Source

pub fn as_object_type_annotation(&self) -> Option<&ObjectTypeAnnotation<'gc>>

The payload if this is a ObjectTypeAnnotation, None otherwise.

Source

pub fn as_object_type_property(&self) -> Option<&ObjectTypeProperty<'gc>>

The payload if this is a ObjectTypeProperty, None otherwise.

Source

pub fn as_object_type_spread_property( &self, ) -> Option<&ObjectTypeSpreadProperty<'gc>>

The payload if this is a ObjectTypeSpreadProperty, None otherwise.

Source

pub fn as_object_type_internal_slot( &self, ) -> Option<&ObjectTypeInternalSlot<'gc>>

The payload if this is a ObjectTypeInternalSlot, None otherwise.

Source

pub fn as_object_type_call_property( &self, ) -> Option<&ObjectTypeCallProperty<'gc>>

The payload if this is a ObjectTypeCallProperty, None otherwise.

Source

pub fn as_object_type_indexer(&self) -> Option<&ObjectTypeIndexer<'gc>>

The payload if this is a ObjectTypeIndexer, None otherwise.

Source

pub fn as_object_type_mapped_type_property( &self, ) -> Option<&ObjectTypeMappedTypeProperty<'gc>>

The payload if this is a ObjectTypeMappedTypeProperty, None otherwise.

Source

pub fn as_variance(&self) -> Option<&Variance<'gc>>

The payload if this is a Variance, None otherwise.

Source

pub fn as_type_parameter_declaration( &self, ) -> Option<&TypeParameterDeclaration<'gc>>

The payload if this is a TypeParameterDeclaration, None otherwise.

Source

pub fn as_type_parameter(&self) -> Option<&TypeParameter<'gc>>

The payload if this is a TypeParameter, None otherwise.

Source

pub fn as_type_parameter_instantiation( &self, ) -> Option<&TypeParameterInstantiation<'gc>>

The payload if this is a TypeParameterInstantiation, None otherwise.

Source

pub fn as_type_cast_expression(&self) -> Option<&TypeCastExpression<'gc>>

The payload if this is a TypeCastExpression, None otherwise.

Source

pub fn as_as_expression(&self) -> Option<&AsExpression<'gc>>

The payload if this is a AsExpression, None otherwise.

Source

pub fn as_as_const_expression(&self) -> Option<&AsConstExpression<'gc>>

The payload if this is a AsConstExpression, None otherwise.

Source

pub fn as_inferred_predicate(&self) -> Option<&InferredPredicate<'gc>>

The payload if this is a InferredPredicate, None otherwise.

Source

pub fn as_declared_predicate(&self) -> Option<&DeclaredPredicate<'gc>>

The payload if this is a DeclaredPredicate, None otherwise.

Source

pub fn as_enum_declaration(&self) -> Option<&EnumDeclaration<'gc>>

The payload if this is a EnumDeclaration, None otherwise.

Source

pub fn as_enum_string_body(&self) -> Option<&EnumStringBody<'gc>>

The payload if this is a EnumStringBody, None otherwise.

Source

pub fn as_enum_number_body(&self) -> Option<&EnumNumberBody<'gc>>

The payload if this is a EnumNumberBody, None otherwise.

Source

pub fn as_enum_big_int_body(&self) -> Option<&EnumBigIntBody<'gc>>

The payload if this is a EnumBigIntBody, None otherwise.

Source

pub fn as_enum_boolean_body(&self) -> Option<&EnumBooleanBody<'gc>>

The payload if this is a EnumBooleanBody, None otherwise.

Source

pub fn as_enum_symbol_body(&self) -> Option<&EnumSymbolBody<'gc>>

The payload if this is a EnumSymbolBody, None otherwise.

Source

pub fn as_enum_defaulted_member(&self) -> Option<&EnumDefaultedMember<'gc>>

The payload if this is a EnumDefaultedMember, None otherwise.

Source

pub fn as_enum_string_member(&self) -> Option<&EnumStringMember<'gc>>

The payload if this is a EnumStringMember, None otherwise.

Source

pub fn as_enum_number_member(&self) -> Option<&EnumNumberMember<'gc>>

The payload if this is a EnumNumberMember, None otherwise.

Source

pub fn as_enum_big_int_member(&self) -> Option<&EnumBigIntMember<'gc>>

The payload if this is a EnumBigIntMember, None otherwise.

Source

pub fn as_enum_boolean_member(&self) -> Option<&EnumBooleanMember<'gc>>

The payload if this is a EnumBooleanMember, None otherwise.

Source

pub fn as_component_parameter(&self) -> Option<&ComponentParameter<'gc>>

The payload if this is a ComponentParameter, None otherwise.

Source

pub fn as_record_declaration(&self) -> Option<&RecordDeclaration<'gc>>

The payload if this is a RecordDeclaration, None otherwise.

Source

pub fn as_record_declaration_implements( &self, ) -> Option<&RecordDeclarationImplements<'gc>>

The payload if this is a RecordDeclarationImplements, None otherwise.

Source

pub fn as_record_declaration_body(&self) -> Option<&RecordDeclarationBody<'gc>>

The payload if this is a RecordDeclarationBody, None otherwise.

Source

pub fn as_record_declaration_property( &self, ) -> Option<&RecordDeclarationProperty<'gc>>

The payload if this is a RecordDeclarationProperty, None otherwise.

Source

pub fn as_record_declaration_static_property( &self, ) -> Option<&RecordDeclarationStaticProperty<'gc>>

The payload if this is a RecordDeclarationStaticProperty, None otherwise.

Source

pub fn as_record_expression(&self) -> Option<&RecordExpression<'gc>>

The payload if this is a RecordExpression, None otherwise.

Source

pub fn as_record_expression_properties( &self, ) -> Option<&RecordExpressionProperties<'gc>>

The payload if this is a RecordExpressionProperties, None otherwise.

Source

pub fn as_ts_type_annotation(&self) -> Option<&TSTypeAnnotation<'gc>>

The payload if this is a TSTypeAnnotation, None otherwise.

Source

pub fn as_ts_any_keyword(&self) -> Option<&TSAnyKeyword<'gc>>

The payload if this is a TSAnyKeyword, None otherwise.

Source

pub fn as_ts_number_keyword(&self) -> Option<&TSNumberKeyword<'gc>>

The payload if this is a TSNumberKeyword, None otherwise.

Source

pub fn as_ts_boolean_keyword(&self) -> Option<&TSBooleanKeyword<'gc>>

The payload if this is a TSBooleanKeyword, None otherwise.

Source

pub fn as_ts_string_keyword(&self) -> Option<&TSStringKeyword<'gc>>

The payload if this is a TSStringKeyword, None otherwise.

Source

pub fn as_ts_symbol_keyword(&self) -> Option<&TSSymbolKeyword<'gc>>

The payload if this is a TSSymbolKeyword, None otherwise.

Source

pub fn as_ts_void_keyword(&self) -> Option<&TSVoidKeyword<'gc>>

The payload if this is a TSVoidKeyword, None otherwise.

Source

pub fn as_ts_undefined_keyword(&self) -> Option<&TSUndefinedKeyword<'gc>>

The payload if this is a TSUndefinedKeyword, None otherwise.

Source

pub fn as_ts_unknown_keyword(&self) -> Option<&TSUnknownKeyword<'gc>>

The payload if this is a TSUnknownKeyword, None otherwise.

Source

pub fn as_ts_never_keyword(&self) -> Option<&TSNeverKeyword<'gc>>

The payload if this is a TSNeverKeyword, None otherwise.

Source

pub fn as_ts_big_int_keyword(&self) -> Option<&TSBigIntKeyword<'gc>>

The payload if this is a TSBigIntKeyword, None otherwise.

Source

pub fn as_ts_this_type(&self) -> Option<&TSThisType<'gc>>

The payload if this is a TSThisType, None otherwise.

Source

pub fn as_ts_literal_type(&self) -> Option<&TSLiteralType<'gc>>

The payload if this is a TSLiteralType, None otherwise.

Source

pub fn as_ts_indexed_access_type(&self) -> Option<&TSIndexedAccessType<'gc>>

The payload if this is a TSIndexedAccessType, None otherwise.

Source

pub fn as_ts_array_type(&self) -> Option<&TSArrayType<'gc>>

The payload if this is a TSArrayType, None otherwise.

Source

pub fn as_ts_type_reference(&self) -> Option<&TSTypeReference<'gc>>

The payload if this is a TSTypeReference, None otherwise.

Source

pub fn as_ts_qualified_name(&self) -> Option<&TSQualifiedName<'gc>>

The payload if this is a TSQualifiedName, None otherwise.

Source

pub fn as_ts_function_type(&self) -> Option<&TSFunctionType<'gc>>

The payload if this is a TSFunctionType, None otherwise.

Source

pub fn as_ts_constructor_type(&self) -> Option<&TSConstructorType<'gc>>

The payload if this is a TSConstructorType, None otherwise.

Source

pub fn as_ts_type_predicate(&self) -> Option<&TSTypePredicate<'gc>>

The payload if this is a TSTypePredicate, None otherwise.

Source

pub fn as_ts_tuple_type(&self) -> Option<&TSTupleType<'gc>>

The payload if this is a TSTupleType, None otherwise.

Source

pub fn as_ts_type_assertion(&self) -> Option<&TSTypeAssertion<'gc>>

The payload if this is a TSTypeAssertion, None otherwise.

Source

pub fn as_ts_as_expression(&self) -> Option<&TSAsExpression<'gc>>

The payload if this is a TSAsExpression, None otherwise.

Source

pub fn as_ts_parameter_property(&self) -> Option<&TSParameterProperty<'gc>>

The payload if this is a TSParameterProperty, None otherwise.

Source

pub fn as_ts_type_alias_declaration( &self, ) -> Option<&TSTypeAliasDeclaration<'gc>>

The payload if this is a TSTypeAliasDeclaration, None otherwise.

Source

pub fn as_ts_interface_declaration( &self, ) -> Option<&TSInterfaceDeclaration<'gc>>

The payload if this is a TSInterfaceDeclaration, None otherwise.

Source

pub fn as_ts_interface_heritage(&self) -> Option<&TSInterfaceHeritage<'gc>>

The payload if this is a TSInterfaceHeritage, None otherwise.

Source

pub fn as_ts_interface_body(&self) -> Option<&TSInterfaceBody<'gc>>

The payload if this is a TSInterfaceBody, None otherwise.

Source

pub fn as_ts_enum_declaration(&self) -> Option<&TSEnumDeclaration<'gc>>

The payload if this is a TSEnumDeclaration, None otherwise.

Source

pub fn as_ts_enum_member(&self) -> Option<&TSEnumMember<'gc>>

The payload if this is a TSEnumMember, None otherwise.

Source

pub fn as_ts_module_declaration(&self) -> Option<&TSModuleDeclaration<'gc>>

The payload if this is a TSModuleDeclaration, None otherwise.

Source

pub fn as_ts_module_block(&self) -> Option<&TSModuleBlock<'gc>>

The payload if this is a TSModuleBlock, None otherwise.

Source

pub fn as_ts_module_member(&self) -> Option<&TSModuleMember<'gc>>

The payload if this is a TSModuleMember, None otherwise.

Source

pub fn as_ts_type_parameter_declaration( &self, ) -> Option<&TSTypeParameterDeclaration<'gc>>

The payload if this is a TSTypeParameterDeclaration, None otherwise.

Source

pub fn as_ts_type_parameter(&self) -> Option<&TSTypeParameter<'gc>>

The payload if this is a TSTypeParameter, None otherwise.

Source

pub fn as_ts_type_parameter_instantiation( &self, ) -> Option<&TSTypeParameterInstantiation<'gc>>

The payload if this is a TSTypeParameterInstantiation, None otherwise.

Source

pub fn as_ts_union_type(&self) -> Option<&TSUnionType<'gc>>

The payload if this is a TSUnionType, None otherwise.

Source

pub fn as_ts_intersection_type(&self) -> Option<&TSIntersectionType<'gc>>

The payload if this is a TSIntersectionType, None otherwise.

Source

pub fn as_ts_type_query(&self) -> Option<&TSTypeQuery<'gc>>

The payload if this is a TSTypeQuery, None otherwise.

Source

pub fn as_ts_conditional_type(&self) -> Option<&TSConditionalType<'gc>>

The payload if this is a TSConditionalType, None otherwise.

Source

pub fn as_ts_type_literal(&self) -> Option<&TSTypeLiteral<'gc>>

The payload if this is a TSTypeLiteral, None otherwise.

Source

pub fn as_ts_property_signature(&self) -> Option<&TSPropertySignature<'gc>>

The payload if this is a TSPropertySignature, None otherwise.

Source

pub fn as_ts_method_signature(&self) -> Option<&TSMethodSignature<'gc>>

The payload if this is a TSMethodSignature, None otherwise.

Source

pub fn as_ts_index_signature(&self) -> Option<&TSIndexSignature<'gc>>

The payload if this is a TSIndexSignature, None otherwise.

Source

pub fn as_ts_call_signature_declaration( &self, ) -> Option<&TSCallSignatureDeclaration<'gc>>

The payload if this is a TSCallSignatureDeclaration, None otherwise.

Source

pub fn as_ts_modifiers(&self) -> Option<&TSModifiers<'gc>>

The payload if this is a TSModifiers, None otherwise.

Source

pub fn as_cover_empty_args(&self) -> Option<&CoverEmptyArgs<'gc>>

The payload if this is a CoverEmptyArgs, None otherwise.

Source

pub fn as_cover_trailing_comma(&self) -> Option<&CoverTrailingComma<'gc>>

The payload if this is a CoverTrailingComma, None otherwise.

Source

pub fn as_cover_initializer(&self) -> Option<&CoverInitializer<'gc>>

The payload if this is a CoverInitializer, None otherwise.

Source

pub fn as_cover_rest_element(&self) -> Option<&CoverRestElement<'gc>>

The payload if this is a CoverRestElement, None otherwise.

Source

pub fn as_cover_typed_identifier(&self) -> Option<&CoverTypedIdentifier<'gc>>

The payload if this is a CoverTypedIdentifier, None otherwise.

Source

pub fn as_sh_builtin(&self) -> Option<&SHBuiltin<'gc>>

The payload if this is a SHBuiltin, None otherwise.

Source

pub fn as_implicit_checked_cast(&self) -> Option<&ImplicitCheckedCast<'gc>>

The payload if this is a ImplicitCheckedCast, None otherwise.

Source

pub fn visit_children<V: Visitor<'gc> + ?Sized>(&'gc self, v: &mut V)

Visit every child node in declared order: the ESTree.def fields plus the decoration lists the GC marker must trace.

Source

pub fn visit_children_mut<V: VisitorMut<'gc>>( &'gc self, ctx: &'gc GCLock<'_, '_>, visitor: &mut V, ) -> TransformResult<&'gc Node<'gc>>

Transform this node’s children with visitor, rebuilding it only if a child changed. self is the original parent.

Source

pub fn mark_lists<F: FnMut(&NodeList<'gc>)>(&'gc self, cb: &mut F)

Call cb on every NodeList field of this node, including decoration lists. Used by the GC to mark list elements.

Source

pub fn node_type_str(&self) -> &'static str

The ESTree node type name — the JSON "type" value.

Source

pub fn dump_children<'a, 'w>(&'gc self, d: &mut ESTreeJSONDumper<'a, 'w>)

Emit this node’s .def child fields as JSON key/values, in declared order. Mirrors C++ visitChildren.

Source

pub fn visit_mut<V: VisitorMut<'gc>>( &'gc self, ctx: &'gc GCLock<'_, '_>, visitor: &mut V, path: Option<Path<'gc>>, ) -> Option<&'gc Node<'gc>>

Top-level transforming entry point. Returns the (maybe-new) root, or None if it was removed.

Trait Implementations§

Source§

impl<'gc> AsRef<Node<'gc>> for NodePtr<'gc>

Source§

fn as_ref(&self) -> &'gc Node<'gc>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'gc> Clone for NodePtr<'gc>

Source§

fn clone(&self) -> NodePtr<'gc>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'gc> Copy for NodePtr<'gc>

Source§

impl<'gc> Debug for NodePtr<'gc>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'gc> Deref for NodePtr<'gc>

Source§

type Target = Node<'gc>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &'gc Self::Target

Dereferences the value.
Source§

impl Eq for NodePtr<'_>

Source§

impl<'gc> From<&'gc Node<'gc>> for NodePtr<'gc>

Source§

fn from(node: &'gc Node<'gc>) -> Self

Converts to this type from the input type.
Source§

impl Hash for NodePtr<'_>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'gc> PartialEq for NodePtr<'gc>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl<'gc> !RefUnwindSafe for NodePtr<'gc>

§

impl<'gc> !Send for NodePtr<'gc>

§

impl<'gc> !Sync for NodePtr<'gc>

§

impl<'gc> !UnwindSafe for NodePtr<'gc>

§

impl<'gc> Freeze for NodePtr<'gc>

§

impl<'gc> Unpin for NodePtr<'gc>

§

impl<'gc> UnsafeUnpin for NodePtr<'gc>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.