pub struct TypeMappingUtils;
Expand description
Type mapping utilities
Implementations§
Source§impl TypeMappingUtils
impl TypeMappingUtils
Sourcepub fn is_primitive(ts_type: &Type) -> bool
pub fn is_primitive(ts_type: &Type) -> bool
Check if a TypeScript type is primitive
Sourcepub fn is_nullable(ts_type: &Type) -> bool
pub fn is_nullable(ts_type: &Type) -> bool
Check if a TypeScript type is nullable
Sourcepub fn is_optional(_ts_type: &Type) -> bool
pub fn is_optional(_ts_type: &Type) -> bool
Check if a TypeScript type is optional
Sourcepub fn get_underlying_type(ts_type: &Type) -> &Type
pub fn get_underlying_type(ts_type: &Type) -> &Type
Get the underlying type for optional types
Sourcepub fn needs_runtime(ts_type: &Type) -> bool
pub fn needs_runtime(ts_type: &Type) -> bool
Check if a TypeScript type needs runtime support
Sourcepub fn generate_imports(ts_type: &Type) -> Vec<String>
pub fn generate_imports(ts_type: &Type) -> Vec<String>
Generate Rust imports for a type
Auto Trait Implementations§
impl Freeze for TypeMappingUtils
impl RefUnwindSafe for TypeMappingUtils
impl Send for TypeMappingUtils
impl Sync for TypeMappingUtils
impl Unpin for TypeMappingUtils
impl UnwindSafe for TypeMappingUtils
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