Struct spirv_cross2::SpirvCrossContext
source · pub struct SpirvCrossContext(/* private fields */);Expand description
The SPIRV-Cross context. All memory allocations originating from this context will have the same lifetime as the context.
Implementations§
source§impl SpirvCrossContext
impl SpirvCrossContext
sourcepub fn new() -> Result<Self, SpirvCrossError>
pub fn new() -> Result<Self, SpirvCrossError>
Initialize a new SPIRV-Cross context.
sourcepub fn create_compiler<T: Target>(
&self,
spirv: Module<'_>,
) -> Result<Compiler<'_, T>, SpirvCrossError>
pub fn create_compiler<T: Target>( &self, spirv: Module<'_>, ) -> Result<Compiler<'_, T>, SpirvCrossError>
Create a compiler instance from a SPIR-V module.
sourcepub fn create_compiler_refcounted<T: Target>(
self: &Rc<Self>,
spirv: Module<'_>,
) -> Result<Compiler<'static, T>, SpirvCrossError>
pub fn create_compiler_refcounted<T: Target>( self: &Rc<Self>, spirv: Module<'_>, ) -> Result<Compiler<'static, T>, SpirvCrossError>
Create a compiler instance from a SPIR-V module.
The compiler instance created carries with it a refcounted
pointer to the SPIRV-Cross context, and thus has a 'static
lifetime.
sourcepub fn into_compiler<T: Target>(
self,
spirv: Module<'_>,
) -> Result<Compiler<'static, T>, SpirvCrossError>
pub fn into_compiler<T: Target>( self, spirv: Module<'_>, ) -> Result<Compiler<'static, T>, SpirvCrossError>
Create a compiler instance from a SPIR-V module.
This consumes the instance so the resulting compiler instance is static, and allocations will be dropped with the compiler.
This allows for instances to be stored without keeping a reference to the context separately.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpirvCrossContext
impl RefUnwindSafe for SpirvCrossContext
impl !Send for SpirvCrossContext
impl !Sync for SpirvCrossContext
impl Unpin for SpirvCrossContext
impl UnwindSafe for SpirvCrossContext
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