Struct glsl_include::Context
[−]
[src]
pub struct Context<'a> { /* fields omitted */ }
A Context stores data required to expand source string inputs
Methods
impl<'a> Context<'a>
[src]
pub fn new() -> Context<'a>
[src]
Returns an empty Context
pub fn include(self, name: &'a str, src: &'a str) -> Self
[src]
Associates an #include name with a GLSL source string
pub fn expand(
&self,
src: &'a str
) -> Result<(Vec<&'a str>, SourceMap<'a>), Error>
[src]
&self,
src: &'a str
) -> Result<(Vec<&'a str>, SourceMap<'a>), Error>
Recursively expands the #include directives within the GLSL source string and returns the expanded source and source map
pub fn expand_to_string(
&self,
src: &'a str
) -> Result<(String, SourceMap<'a>), Error>
[src]
&self,
src: &'a str
) -> Result<(String, SourceMap<'a>), Error>
Like expand
but joins the expanded source with newlines
pub fn expand_to_bytes(
&self,
src: &'a str
) -> Result<(Vec<&[u8]>, SourceMap<'a>), Error>
[src]
&self,
src: &'a str
) -> Result<(Vec<&[u8]>, SourceMap<'a>), Error>
Like expand
but maps the expanded source to a Vec of &[u8]
Trait Implementations
impl<'a> Debug for Context<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more