Struct naga_oil::redirect::Redirector
source · pub struct Redirector { /* private fields */ }
Implementations§
source§impl Redirector
impl Redirector
pub fn new(module: Module) -> Self
sourcepub fn redirect_function(
&mut self,
original: &str,
replacement: &str,
omit: &HashSet<String>
) -> Result<(Handle<Function>, Handle<Function>), RedirectError>
pub fn redirect_function( &mut self, original: &str, replacement: &str, omit: &HashSet<String> ) -> Result<(Handle<Function>, Handle<Function>), RedirectError>
redirect all calls to the function named original
with references to the function named replacement
, except within the replacement function
or in any function contained in the omit
set.
returns handles to the original and replacement functions.
NB: requires the replacement to be defined in the arena before any calls to the original, or validation will fail.
pub fn into_module(self) -> Result<Module, RedirectError>
Trait Implementations§
source§impl TryFrom<Redirector> for Module
impl TryFrom<Redirector> for Module
§type Error = RedirectError
type Error = RedirectError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl RefUnwindSafe for Redirector
impl Send for Redirector
impl Sync for Redirector
impl Unpin for Redirector
impl UnwindSafe for Redirector
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