logo
pub struct Snippet { /* private fields */ }

Implementations

Allocates and initializes a new snippet with the given source strings.

hook

The point in the pipeline that this snippet will wrap around or replace.

declarations

The source code for the declarations for this snippet or None. See Snippet::set_declarations.

post

The source code to run after the hook point where this shader snippet is attached or None. See Snippet::set_post.

Returns

a pointer to a new Snippet

Returns

the source string that was set with Snippet::set_declarations or None if none was set.

Returns

the hook that was set when Snippet::new was called.

Returns

the source string that was set with Snippet::set_post or None if none was set.

Returns

the source string that was set with Snippet::set_pre or None if none was set.

Returns

the source string that was set with Snippet::set_replace or None if none was set.

Sets a source string that will be inserted in the global scope of the generated shader when this snippet is used on a pipeline. This string is typically used to declare uniforms, attributes or functions that will be used by the other parts of the snippets.

This fn should only be called before the snippet is attached to its first pipeline. After that the snippet should be considered immutable.

declarations

The new source string for the declarations section of this snippet.

source

pub fn set_post(&self, post: &str)

Sets a source string that will be inserted after the hook point in the generated shader for the pipeline that this snippet is attached to. Please see the documentation of each hook point in Pipeline for a description of how this string should be used.

This fn should only be called before the snippet is attached to its first pipeline. After that the snippet should be considered immutable.

post

The new source string for the post section of this snippet.

Sets a source string that will be inserted before the hook point in the generated shader for the pipeline that this snippet is attached to. Please see the documentation of each hook point in Pipeline for a description of how this string should be used.

This fn should only be called before the snippet is attached to its first pipeline. After that the snippet should be considered immutable.

pre

The new source string for the pre section of this snippet.

Sets a source string that will be used instead of any generated source code or any previous snippets for this hook point. Please see the documentation of each hook point in Pipeline for a description of how this string should be used.

This fn should only be called before the snippet is attached to its first pipeline. After that the snippet should be considered immutable.

replace

The new source string for the replace section of this snippet.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.