pub struct TypeResolver { /* private fields */ }Expand description
Type resolver for mapping Rust types to TypeScript types
Implementations§
Source§impl TypeResolver
impl TypeResolver
pub fn new() -> Self
Sourcepub fn map_rust_type_to_typescript(&mut self, rust_type: &str) -> String
pub fn map_rust_type_to_typescript(&mut self, rust_type: &str) -> String
Map a Rust type string to TypeScript type string
Sourcepub fn get_type_mappings(&self) -> &HashMap<String, String>
pub fn get_type_mappings(&self) -> &HashMap<String, String>
Get the type mappings
Sourcepub fn add_type_mapping(&mut self, rust_type: String, typescript_type: String)
pub fn add_type_mapping(&mut self, rust_type: String, typescript_type: String)
Add a custom type mapping
Trait Implementations§
Source§impl Debug for TypeResolver
impl Debug for TypeResolver
Auto Trait Implementations§
impl Freeze for TypeResolver
impl RefUnwindSafe for TypeResolver
impl Send for TypeResolver
impl Sync for TypeResolver
impl Unpin for TypeResolver
impl UnwindSafe for TypeResolver
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