pub struct Context { /* private fields */ }
Expand description
A context of IR, dialects, and passes.
Contexts own various objects, such as types, locations, and dialect instances.
Implementations§
source§impl Context
impl Context
sourcepub fn registered_dialect_count(&self) -> usize
pub fn registered_dialect_count(&self) -> usize
Returns a number of registered dialects.
sourcepub fn loaded_dialect_count(&self) -> usize
pub fn loaded_dialect_count(&self) -> usize
Returns a number of loaded dialects.
sourcepub fn get_or_load_dialect(&self, name: &str) -> Dialect<'_>
pub fn get_or_load_dialect(&self, name: &str) -> Dialect<'_>
Returns or loads a dialect.
sourcepub fn append_dialect_registry(&self, registry: &DialectRegistry)
pub fn append_dialect_registry(&self, registry: &DialectRegistry)
Appends a dialect registry.
sourcepub fn load_all_available_dialects(&self)
pub fn load_all_available_dialects(&self)
Loads all available dialects.
sourcepub fn enable_multi_threading(&self, enabled: bool)
pub fn enable_multi_threading(&self, enabled: bool)
Enables multi-threading.
sourcepub fn allow_unregistered_dialects(&self) -> bool
pub fn allow_unregistered_dialects(&self) -> bool
Returns true
if unregistered dialects are allowed.
sourcepub fn set_allow_unregistered_dialects(&self, allowed: bool)
pub fn set_allow_unregistered_dialects(&self, allowed: bool)
Sets if unregistered dialects are allowed.
sourcepub fn is_registered_operation(&self, name: &str) -> bool
pub fn is_registered_operation(&self, name: &str) -> bool
Returns true
if a given operation is registered in a context.
sourcepub const fn to_raw(&self) -> MlirContext
pub const fn to_raw(&self) -> MlirContext
Converts a context into a raw object.
sourcepub fn attach_diagnostic_handler<F: FnMut(Diagnostic<'_>) -> bool>(
&self,
handler: F,
) -> DiagnosticHandlerId
pub fn attach_diagnostic_handler<F: FnMut(Diagnostic<'_>) -> bool>( &self, handler: F, ) -> DiagnosticHandlerId
Attaches a diagnostic handler.
sourcepub fn detach_diagnostic_handler(&self, id: DiagnosticHandlerId)
pub fn detach_diagnostic_handler(&self, id: DiagnosticHandlerId)
Detaches a diagnostic handler.
Trait Implementations§
source§impl<'c> PartialEq<Context> for ContextRef<'c>
impl<'c> PartialEq<Context> for ContextRef<'c>
source§impl<'a> PartialEq<ContextRef<'a>> for Context
impl<'a> PartialEq<ContextRef<'a>> for Context
source§fn eq(&self, other: &ContextRef<'a>) -> bool
fn eq(&self, other: &ContextRef<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq for Context
impl PartialEq for Context
impl Eq for Context
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl !Send for Context
impl !Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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