pub struct ShaderSymbols { /* private fields */ }Implementations§
Source§impl ShaderSymbols
impl ShaderSymbols
pub fn new(file_path: &Path, shader_params: ShaderContextParams) -> Self
Sourcepub fn get_all_symbols<'a>(&'a self) -> ShaderSymbolListRef<'a>
pub fn get_all_symbols<'a>(&'a self) -> ShaderSymbolListRef<'a>
Examples found in repository?
examples/main.rs (line 43)
29fn query_all_symbol<T: ShadingLanguageTag>(shader_path: &Path, shader_content: &str) {
30 // SymbolProvider intended to gather file symbol at runtime by inspecting the AST.
31 let mut shader_module_parser = ShaderModuleParser::from_shading_language(T::get_language());
32 let symbol_provider = SymbolProvider::from_shading_language(T::get_language());
33 match shader_module_parser.create_module(shader_path, shader_content) {
34 Ok(shader_module) => {
35 let symbols = symbol_provider
36 .query_symbols(
37 &shader_module,
38 ShaderParams::default(),
39 &mut default_include_callback::<T>,
40 None,
41 )
42 .unwrap();
43 let symbol_list = symbols.get_all_symbols();
44 println!("Found symbols: {:#?}", symbol_list);
45 }
46 Err(err) => println!("Failed to create ast: {:#?}", err),
47 }
48}pub fn get_local_symbols<'a>(&'a self) -> ShaderSymbolListRef<'a>
pub fn get_context(&self) -> &ShaderPreprocessorContext
pub fn get_preprocessor(&self) -> &ShaderPreprocessor
pub fn get_preprocessor_mut(&mut self) -> &mut ShaderPreprocessor
pub fn visit_includes<F: FnMut(&ShaderPreprocessorInclude)>( &self, callback: &mut F, )
pub fn visit_includes_mut<F: FnMut(&mut ShaderPreprocessorInclude)>( &mut self, callback: &mut F, )
pub fn find_include_stack<F: FnMut(&ShaderPreprocessorInclude) -> bool>( &self, callback: &mut F, ) -> Option<Vec<&ShaderPreprocessorInclude>>
pub fn find_include<F: FnMut(&ShaderPreprocessorInclude) -> bool>( &self, callback: &mut F, ) -> Option<&ShaderPreprocessorInclude>
pub fn find_direct_includer( &self, include_path: &Path, ) -> Option<&ShaderPreprocessorInclude>
pub fn has_dependency(&self, dependency_to_find_path: &Path) -> bool
pub fn dump_dependency_tree(&self, absolute_path: &PathBuf) -> String
Trait Implementations§
Source§impl Clone for ShaderSymbols
impl Clone for ShaderSymbols
Source§fn clone(&self) -> ShaderSymbols
fn clone(&self) -> ShaderSymbols
Returns a duplicate 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 ShaderSymbols
impl Debug for ShaderSymbols
Source§impl Default for ShaderSymbols
impl Default for ShaderSymbols
Source§fn default() -> ShaderSymbols
fn default() -> ShaderSymbols
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ShaderSymbols
impl RefUnwindSafe for ShaderSymbols
impl Send for ShaderSymbols
impl Sync for ShaderSymbols
impl Unpin for ShaderSymbols
impl UnwindSafe for ShaderSymbols
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