naga::back::wgsl::writer

Struct WriterTypeContext

Source
struct WriterTypeContext<'m> {
    module: &'m Module,
    names: &'m FastHashMap<NameKey, String>,
}

Fields§

§module: &'m Module§names: &'m FastHashMap<NameKey, String>

Trait Implementations§

Source§

impl TypeContext for WriterTypeContext<'_>

Source§

fn lookup_type(&self, handle: Handle<Type>) -> &Type

Return the Type referred to by handle.
Source§

fn type_name(&self, handle: Handle<Type>) -> &str

Return the name to be used for the type referred to by handle.
Source§

fn write_unnamed_struct<W: Write>(&self, _: &TypeInner, _: &mut W) -> Result

Write a TypeInner::Struct for which we are unable to find a name. Read more
Source§

fn write_override<W: Write>(&self, _: Handle<Override>, _: &mut W) -> Result

Write the WGSL form of override to out.
Source§

fn write_non_wgsl_inner<W: Write>(&self, _: &TypeInner, _: &mut W) -> Result

Write a TypeInner that has no representation as WGSL source, even including Naga extensions. Read more
Source§

fn write_non_wgsl_scalar<W: Write>(&self, _: Scalar, _: &mut W) -> Result

Write a Scalar that has no representation as WGSL source, even including Naga extensions. Read more
Source§

fn write_type<W: Write>(&self, handle: Handle<Type>, out: &mut W) -> Result

Write the type ty as it would appear in a value’s declaration. Read more
Source§

fn write_type_inner<W: Write>(&self, inner: &TypeInner, out: &mut W) -> Result

Write the TypeInner inner as it would appear in a value’s declaration. Read more
Source§

fn write_scalar<W: Write>(&self, scalar: Scalar, out: &mut W) -> Result

Write the Scalar scalar as a WGSL type.
Source§

fn write_type_resolution<W: Write>( &self, resolution: &TypeResolution, out: &mut W, ) -> Result

Write the TypeResolution resolution as a WGSL type.
Source§

fn write_type_conclusion<W: Write>( &self, conclusion: &Conclusion, out: &mut W, ) -> Result

Source§

fn write_type_rule<W: Write>( &self, name: &str, rule: &Rule, out: &mut W, ) -> Result

Source§

fn type_to_string(&self, handle: Handle<Type>) -> String

Source§

fn type_resolution_to_string(&self, resolution: &TypeResolution) -> String

Source§

fn type_rule_to_string(&self, name: &str, rule: &Rule) -> String

Auto Trait Implementations§

§

impl<'m> Freeze for WriterTypeContext<'m>

§

impl<'m> RefUnwindSafe for WriterTypeContext<'m>

§

impl<'m> Send for WriterTypeContext<'m>

§

impl<'m> Sync for WriterTypeContext<'m>

§

impl<'m> Unpin for WriterTypeContext<'m>

§

impl<'m> UnwindSafe for WriterTypeContext<'m>

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.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.