pub enum TemplateLang {
Wgsl,
Glsl,
}Expand description
The shader languages where the templates can be generated for.
§Example
use shady::TemplateLang;
// Create a template in wgsl
let template = TemplateLang::Wgsl
.generate_to_string(None) // You can also provide your own code which should be placed within the main function
.unwrap();Variants§
Implementations§
Source§impl TemplateLang
impl TemplateLang
Sourcepub fn generate(
self,
writer: &mut dyn Write,
body: Option<&str>,
) -> Result<(), Error>
pub fn generate( self, writer: &mut dyn Write, body: Option<&str>, ) -> Result<(), Error>
Create the template and write it to the given writer.
§Arguments
writer: Where to write the template into.body: Optional shadercode which should be pasted into the main function of the fragment.
§Example
use shady::TemplateLang;
let mut template = String::new();
// Generate the template and store it into `template`.
TemplateLang::Wgsl
.generate(&mut template, None)
.unwrap();Trait Implementations§
Source§impl Clone for TemplateLang
impl Clone for TemplateLang
Source§fn clone(&self) -> TemplateLang
fn clone(&self) -> TemplateLang
Returns a copy 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 TemplateLang
impl Debug for TemplateLang
Source§impl Hash for TemplateLang
impl Hash for TemplateLang
impl Copy for TemplateLang
Auto Trait Implementations§
impl Freeze for TemplateLang
impl RefUnwindSafe for TemplateLang
impl Send for TemplateLang
impl Sync for TemplateLang
impl Unpin for TemplateLang
impl UnwindSafe for TemplateLang
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