pub struct WgslBindgenOptionBuilder { /* private fields */ }
Expand description

Builder for WgslBindgenOption.

Implementations§

source§

impl WgslBindgenOptionBuilder

source

pub fn entry_points<VALUE: Into<Vec<String>>>( &mut self, value: VALUE ) -> &mut Self

A vector of entry points to be added. Each entry point is represented as a String.

source

pub fn add_entry_point<VALUE, FROM_VALUE: Into<VALUE>>( &mut self, item: FROM_VALUE ) -> &mut Self
where Vec<String>: Default + Extend<VALUE>,

A vector of entry points to be added. Each entry point is represented as a String.

source

pub fn module_import_root<VALUE: Into<String>>( &mut self, value: VALUE ) -> &mut Self

The root prefix/namespace if any applied to all shaders given as the entrypoints.

source

pub fn emit_rerun_if_change<VALUE: Into<bool>>( &mut self, value: VALUE ) -> &mut Self

A boolean flag indicating whether to emit a rerun-if-changed directive to Cargo. Defaults to true.

source

pub fn skip_header_comments<VALUE: Into<bool>>( &mut self, value: VALUE ) -> &mut Self

A boolean flag indicating whether to skip header comments. Enabling headers allows to not rerun if contents did not change.

source

pub fn skip_hash_check<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

A boolean flag indicating whether to skip the hash check. This will avoid reruns of bindings generation if entry shaders including their imports has not changed. Defaults to false.

source

pub fn serialization_strategy<VALUE: Into<WgslTypeSerializeStrategy>>( &mut self, value: VALUE ) -> &mut Self

Derive encase::ShaderType for user defined WGSL structs when WgslTypeSerializeStrategy::Encase. else derive bytemuck

source

pub fn derive_serde<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

Derive serde::Serialize and serde::Deserialize for user defined WGSL structs when true.

source

pub fn shader_source_output_type<VALUE: Into<WgslShaderSourceOutputType>>( &mut self, value: VALUE ) -> &mut Self

The type of output for the shader source. Defaults to FinalShaderString.

source

pub fn output_file<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self

The output file path for the generated Rust bindings. Defaults to None.

source

pub fn additional_scan_dirs<VALUE: Into<Vec<AdditionalScanDirectory>>>( &mut self, value: VALUE ) -> &mut Self

The additional set of directories to scan for source files.

source

pub fn additional_scan_dir<VALUE, FROM_VALUE: Into<VALUE>>( &mut self, item: FROM_VALUE ) -> &mut Self

The additional set of directories to scan for source files.

source

pub fn ir_capabilities<VALUE: Into<WgslShaderIRCapabilities>>( &mut self, value: VALUE ) -> &mut Self

wgpu::naga::valid::Capabilities The capabilities of naga to support. Defaults to None.

source

pub fn short_constructor<VALUE: Into<i32>>(&mut self, value: VALUE) -> &mut Self

Whether to generate short constructor similar to enums instead of new, if parameters are below the specified threshold Defaults to None

source§

impl WgslBindgenOptionBuilder

source

pub fn build(&self) -> Result<WGSLBindgen, WgslBindgenError>

source

pub fn wgsl_type_map(&mut self, map_build: impl WgslTypeMapBuild) -> &mut Self

Trait Implementations§

source§

impl Clone for WgslBindgenOptionBuilder

source§

fn clone(&self) -> WgslBindgenOptionBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for WgslBindgenOptionBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more