pub trait FromCompilation<T, S> {
type Target: OutputTarget;
type Options;
type Context;
type Output: CompileShader<Self::Target, Context = Self::Context, Options = Self::Options> + ReflectShader;
// Required method
fn from_compilation(
compile: T,
) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>;
}
Expand description
A trait for reflectable compilations that can be transformed into an object ready for reflection or compilation.
T
is the compiled reflectable form of the shader.
S
is the semantics under which the shader is reflected.
librashader currently supports two semantics, SpirvCross
Required Associated Types§
Sourcetype Target: OutputTarget
type Target: OutputTarget
The target that the transformed object is expected to compile for.
Sourcetype Output: CompileShader<Self::Target, Context = Self::Context, Options = Self::Options> + ReflectShader
type Output: CompileShader<Self::Target, Context = Self::Context, Options = Self::Options> + ReflectShader
The output type after conversion.
Required Methods§
Sourcefn from_compilation(
compile: T,
) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
fn from_compilation( compile: T, ) -> Result<CompilerBackend<Self::Output>, ShaderReflectError>
Tries to convert the input object into an object ready for compilation.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.