#[non_exhaustive]pub enum TypeCheckMode {
Off,
Warn,
Error,
}Expand description
How strictly a typed handle checks a port’s declared URN (§9.2).
The default is TypeCheckMode::Warn in 0.1.0: a type system nobody can
switch on is useless, and one that breaks every existing graph on upgrade
is worse. warn makes drift visible without making it fatal; error is
what a validated deployment sets.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Off
Do not check declared types at all.
Warn
Log a warning on a mismatch and continue (the 0.1.0 default).
Error
Refuse the handle with NodeError::TypeMismatch.
Implementations§
Source§impl TypeCheckMode
impl TypeCheckMode
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The lower-case name used by ASTRS_TYPE_CHECK and by metrics labels.
Sourcepub const fn is_enabled(self) -> bool
pub const fn is_enabled(self) -> bool
Whether a mismatch is examined at all.
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Reads the mode from ASTRS_TYPE_CHECK, defaulting to
TypeCheckMode::Warn.
§Errors
NodeError::BadEnv when the variable names something else.
Trait Implementations§
Source§impl Clone for TypeCheckMode
impl Clone for TypeCheckMode
impl Copy for TypeCheckMode
Source§impl Debug for TypeCheckMode
impl Debug for TypeCheckMode
Source§impl Default for TypeCheckMode
impl Default for TypeCheckMode
Source§impl Display for TypeCheckMode
impl Display for TypeCheckMode
impl Eq for TypeCheckMode
Source§impl FromStr for TypeCheckMode
impl FromStr for TypeCheckMode
Source§impl Hash for TypeCheckMode
impl Hash for TypeCheckMode
Source§impl Ord for TypeCheckMode
impl Ord for TypeCheckMode
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for TypeCheckMode
impl PartialEq for TypeCheckMode
Source§impl PartialOrd for TypeCheckMode
impl PartialOrd for TypeCheckMode
impl StructuralPartialEq for TypeCheckMode
Auto Trait Implementations§
impl Freeze for TypeCheckMode
impl RefUnwindSafe for TypeCheckMode
impl Send for TypeCheckMode
impl Sync for TypeCheckMode
impl Unpin for TypeCheckMode
impl UnsafeUnpin for TypeCheckMode
impl UnwindSafe for TypeCheckMode
Blanket Implementations§
impl<T> Allocation for T
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