Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Wulf/tsync
/ functions
Functions
46 in github.com/Wulf/tsync
⨍
Functions
46
◇
Types & classes
138
↓ 11 callers
Function
get_attribute_arg
Get the value matching an attribute and argument combination For #[serde(tag = "type")], get_attribute_arg("serde", "tag", attributes) will return So
src/utils.rs:116
↓ 10 callers
Function
get_comments
Get the doc string comments from the syn::attributes note: the compiler transforms doc comments into attributes see: https://docs.rs/syn/2.0.28/syn/st
src/utils.rs:170
↓ 10 callers
Method
write_comments
(&mut self, comments: &Vec<String>, indentation_amount: i8)
src/lib.rs:63
↓ 6 callers
Function
convert_type
(ty: &syn::Type)
src/typescript.rs:174
↓ 4 callers
Function
convert_generic
(gen_ty: &syn::GenericArgument)
src/typescript.rs:16
↓ 4 callers
Function
extract_struct_generics
(s: syn::Generics)
src/utils.rs:197
↓ 4 callers
Function
process_fields
# arguments - `use_empty_object_type` - if true, will use the empty object type as the type of the struct if it has no fields
src/to_typescript/structs.rs:76
↓ 4 callers
Function
process_tuple_fields
Process tuple fields NOTE: Currently, this function does not handle comments or attributes on tuple fields. # Example ```ignore struct Todo(String,
src/to_typescript/structs.rs:158
↓ 3 callers
Function
build_indentation
Generate a string filled with `indentation_amount` white-space literal `chars`. # Example ```rust for i in 0..64 { let indentations: String = (0..i).
src/utils.rs:191
↓ 2 callers
Function
format_generics
(generics: &[syn::Ident])
src/utils.rs:210
↓ 2 callers
Function
generate_typescript_defs_inner
( input: Vec<PathBuf>, uses_type_interface: bool, debug: bool, enable_const_enums: bool, )
src/lib.rs:203
↓ 2 callers
Function
parse_serde_case
( val: impl Into<Option<String>>, )
src/utils.rs:272
↓ 2 callers
Function
process_rust_file
( input_path: P, state: &mut BuildState, config: &BuildSettings, )
src/lib.rs:108
↓ 1 callers
Function
add_enum
This convert an all unit enums to a union of const strings in Typescript. It will ignore any discriminants.
src/to_typescript/enums.rs:53
↓ 1 callers
Function
add_externally_tagged_enum
This follows serde's default approach of external tagging
src/to_typescript/enums.rs:355
↓ 1 callers
Function
add_internally_tagged_enum
Conversion of Rust Enum to Typescript using internal tagging as per https://serde.rs/enum-representations.html meaning tuple structs will not be suppo
src/to_typescript/enums.rs:202
↓ 1 callers
Function
add_numeric_enum
Numeric enums. These will be converted using enum syntax or const enum syntax, depending on the `const_enum` parameter. # Examples Given the followi
src/to_typescript/enums.rs:124
↓ 1 callers
Function
add_untagged_tagged_enum
( exported_struct: syn::ItemEnum, state: &mut BuildState, casing: Option<Case>, uses_type_inte
src/to_typescript/enums.rs:407
↓ 1 callers
Function
check_extension
(ext: &OsStr, path: P)
src/lib.rs:149
↓ 1 callers
Function
check_path
(path: P, state: &mut BuildState)
src/lib.rs:137
↓ 1 callers
Function
check_token
(token: proc_macro2::TokenTree, arg: &str)
src/utils.rs:51
↓ 1 callers
Function
extract_custom_type
(segment: &syn::PathSegment)
src/typescript.rs:143
↓ 1 callers
Function
generate_typescript_defs
( input: Vec<PathBuf>, output: PathBuf, debug: bool, enable_const_enums: bool, )
src/lib.rs:234
↓ 1 callers
Function
get_attribute
Get the attribute matching needle name.
src/utils.rs:248
↓ 1 callers
Function
get_intersections
(fields: &syn::Fields)
src/to_typescript/structs.rs:175
↓ 1 callers
Function
has_attribute
(needle: &str, attributes: &[syn::Attribute])
src/utils.rs:17
↓ 1 callers
Function
has_attribute_arg
Check has an attribute arg.
src/utils.rs:129
↓ 1 callers
Function
parse_number_autoradix
Parse a number automaticly handling radix like rust does. 0x - Hex notation 0o - Octal notation 0b - Binary notation
src/utils.rs:287
↓ 1 callers
Function
process_dir_entry
(path: P, state: &mut BuildState, config: &BuildSettings)
src/lib.rs:186
↓ 1 callers
Function
process_rust_item
(item: syn::Item, state: &mut BuildState, config: &BuildSettings)
src/lib.rs:82
↓ 1 callers
Function
try_match_ident_str
Returns Err(()) when no match is found
src/typescript.rs:24
↓ 1 callers
Function
try_match_with_args
Returns Err(()) when no match is found
src/typescript.rs:52
↓ 1 callers
Function
type_contains_ident
Determine whether a type contains the given ident.
src/utils.rs:224
↓ 1 callers
Function
validate_dir_entry
Ensure that the walked entry result is Ok and its path is a file. If not, return `None`, otherwise return `Some(DirEntry)`.
src/lib.rs:162
Function
check_doc_attribute
Checks if an attribute's [`syn::Meta`] property is a name-value pair, like `doc = "Single line doc comments"`. if so, continues to check that the valu
src/utils.rs:151
Function
check_doc_tokens
Checks if a [`proc_macro2::TokenTree`] is a literal character ('a'), string ("hello"), number (2.3), etc. If so, trim it to retain only the comment bo
src/utils.rs:139
Function
check_expression_is_path
Ensures that a parsed expression is a valid Rust module-like path and the path contains valid segments. # Example ```rust let expression: syn::Result
src/utils.rs:44
Method
convert_to_ts
(self, state: &mut BuildState, config: &crate::BuildSettings)
src/to_typescript/type_item.rs:5
Method
convert_to_ts
(self, state: &mut BuildState, config: &crate::BuildSettings)
src/to_typescript/consts.rs:7
Method
convert_to_ts
(self, state: &mut BuildState, config: &crate::BuildSettings)
src/to_typescript/structs.rs:7
Method
convert_to_ts
(self, state: &mut BuildState, config: &crate::BuildSettings)
src/to_typescript/enums.rs:12
Method
from
(ts_type: String)
src/typescript.rs:8
Function
has_tsync_attribute
(attributes: &[syn::Attribute])
src/lib.rs:58
Function
main
()
bin/main.rs:60
Function
test_parse_number
()
src/utils.rs:303
Function
tsync
(_attr: TokenStream, item: TokenStream)
tsync-macro/src/lib.rs:7