pub struct EscapeMangler;Expand description
A mangler that replaces :: with _ and prefixes components with the number of _
they contain.
e.g. foo::bar_baz item => foo__1bar_baz_item
This is WESL’s default mangler.
If a component contains _, it is prefixed by _, followed by the number of _.
This scheme guarantees that paths can be unambiguously mangled and unmangled.
Trait Implementations§
Source§impl Clone for EscapeMangler
impl Clone for EscapeMangler
Source§fn clone(&self) -> EscapeMangler
fn clone(&self) -> EscapeMangler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EscapeMangler
impl Debug for EscapeMangler
Source§impl Default for EscapeMangler
impl Default for EscapeMangler
Source§fn default() -> EscapeMangler
fn default() -> EscapeMangler
Returns the “default value” for a type. Read more
Source§impl Mangler for EscapeMangler
impl Mangler for EscapeMangler
Source§fn unmangle(&self, mangled: &str) -> Option<(ModulePath, String)>
fn unmangle(&self, mangled: &str) -> Option<(ModulePath, String)>
This function does not check that the module names are valid. Unmangling invalid names (or names not mangled with the EscapeMangler) may produce erroneous results.
Source§fn mangle(&self, path: &ModulePath, item: &str) -> String
fn mangle(&self, path: &ModulePath, item: &str) -> String
Turn an import path and item name into a mangled WGSL identifier.
Source§fn mangle_types(
&self,
item: &str,
variant: u32,
_types: &[TypeExpression],
) -> String
fn mangle_types( &self, item: &str, variant: u32, _types: &[TypeExpression], ) -> String
Used for generics. Is experimental. Implementing is optional.
Auto Trait Implementations§
impl Freeze for EscapeMangler
impl RefUnwindSafe for EscapeMangler
impl Send for EscapeMangler
impl Sync for EscapeMangler
impl Unpin for EscapeMangler
impl UnsafeUnpin for EscapeMangler
impl UnwindSafe for EscapeMangler
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more