pub struct PragmaSnapshot { /* private fields */ }Expand description
Immutable compile-time snapshot of pragma state.
This is the stable value object returned by position queries, and the same type used by lexical save/restore operations while building an environment.
Implementations§
Source§impl PragmaSnapshot
impl PragmaSnapshot
Sourcepub fn from_state(state: PragmaState) -> PragmaSnapshot
pub fn from_state(state: PragmaState) -> PragmaSnapshot
Create a snapshot from a concrete state value.
Sourcepub fn state(&self) -> &PragmaState
pub fn state(&self) -> &PragmaState
Borrow the underlying state.
Sourcepub fn strict_enabled(&self) -> bool
pub fn strict_enabled(&self) -> bool
Whether all strict categories are active in this snapshot.
Sourcepub fn warnings_enabled(&self) -> bool
pub fn warnings_enabled(&self) -> bool
Whether warnings are globally active in this snapshot.
Sourcepub fn has_feature(&self, feature: &str) -> bool
pub fn has_feature(&self, feature: &str) -> bool
Whether a feature is enabled in this snapshot.
Sourcepub fn is_warning_active(&self, category: &str) -> bool
pub fn is_warning_active(&self, category: &str) -> bool
Returns true if warnings are active for the given category.
Trait Implementations§
Source§impl Clone for PragmaSnapshot
impl Clone for PragmaSnapshot
Source§fn clone(&self) -> PragmaSnapshot
fn clone(&self) -> PragmaSnapshot
Returns a duplicate of the value. Read more
1.0.0 · 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 PragmaSnapshot
impl Debug for PragmaSnapshot
Source§impl Default for PragmaSnapshot
impl Default for PragmaSnapshot
Source§fn default() -> PragmaSnapshot
fn default() -> PragmaSnapshot
Returns the “default value” for a type. Read more
Source§impl From<PragmaSnapshot> for PragmaState
impl From<PragmaSnapshot> for PragmaState
Source§fn from(snapshot: PragmaSnapshot) -> PragmaState
fn from(snapshot: PragmaSnapshot) -> PragmaState
Converts to this type from the input type.
Source§impl From<PragmaState> for PragmaSnapshot
impl From<PragmaState> for PragmaSnapshot
Source§fn from(state: PragmaState) -> PragmaSnapshot
fn from(state: PragmaState) -> PragmaSnapshot
Converts to this type from the input type.
Source§impl PartialEq for PragmaSnapshot
impl PartialEq for PragmaSnapshot
impl StructuralPartialEq for PragmaSnapshot
Auto Trait Implementations§
impl Freeze for PragmaSnapshot
impl RefUnwindSafe for PragmaSnapshot
impl Send for PragmaSnapshot
impl Sync for PragmaSnapshot
impl Unpin for PragmaSnapshot
impl UnsafeUnpin for PragmaSnapshot
impl UnwindSafe for PragmaSnapshot
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