pub struct TypeParameter {
pub name: String,
pub default: Option<TypeAnnotation>,
pub extends: Option<TypeAnnotation>,
pub position: Span,
pub is_constant: bool,
}
Expand description
Represents a generic parameter. Can have default or constraint to extend a type or a key of a type
TODO is default and extends mut ex
Fields§
§name: String
§default: Option<TypeAnnotation>
§extends: Option<TypeAnnotation>
§position: Span
§is_constant: bool
Trait Implementations§
Source§impl ASTNode for TypeParameter
impl ASTNode for TypeParameter
fn from_reader( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, options: &ParseOptions, ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, options: &ToStringOptions, local: LocalToStringInformation, )
Source§fn get_position(&self) -> Span
fn get_position(&self) -> Span
Returns position of node as span AS IT WAS PARSED. May be
Span::NULL
if AST was doesn’t match anything in sourceSource§fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
From string, with default impl to call abstract method
from_reader
fn from_string_with_options( script: String, options: ParseOptions, offset: Option<u32>, ) -> ParseResult<(Self, ParsingState)>
Source§fn to_string(&self, options: &ToStringOptions) -> String
fn to_string(&self, options: &ToStringOptions) -> String
Returns structure as valid string
Source§impl Clone for TypeParameter
impl Clone for TypeParameter
Source§fn clone(&self) -> TypeParameter
fn clone(&self) -> TypeParameter
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TypeParameter
impl Debug for TypeParameter
Source§impl ListItem for TypeParameter
impl ListItem for TypeParameter
type LAST = ()
const LAST_PREFIX: Option<TSXToken> = None
const EMPTY: Option<Self> = None
fn parse_last_item( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, options: &ParseOptions, ) -> ParseResult<Self::LAST>
Source§impl PartialEq for TypeParameter
impl PartialEq for TypeParameter
Source§impl SelfRustTokenize for TypeParameter
impl SelfRustTokenize for TypeParameter
fn append_to_token_stream(&self, token_stream: &mut TokenStream)
Source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self
Source§impl Serialize for TypeParameter
impl Serialize for TypeParameter
impl StructuralPartialEq for TypeParameter
Auto Trait Implementations§
impl Freeze for TypeParameter
impl RefUnwindSafe for TypeParameter
impl Send for TypeParameter
impl Sync for TypeParameter
impl Unpin for TypeParameter
impl UnwindSafe for TypeParameter
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