pub enum AssertMessageAnnotations {
Off,
MaxBytes(NonZeroU32),
}Expand description
Controls the pytest-style introspected assert failure messages of
CompileOptions::assert_message_annotations.
The choice is baked in at compile time (whether the introspecting opcodes are emitted) but the truncation limit is applied at runtime, so it also travels with serialized sessions.
Variants§
Off
Disable introspection; bare asserts use CPython’s empty message.
MaxBytes(NonZeroU32)
Retain at most this many UTF-8 bytes per operand before any … suffix.
Non-zero because 0 encodes Off on the wire.
Implementations§
Source§impl AssertMessageAnnotations
impl AssertMessageAnnotations
Sourcepub const DEFAULT_MAX_BYTES: NonZeroU32
pub const DEFAULT_MAX_BYTES: NonZeroU32
Operand-repr truncation used by Default and From<bool>.
Sourcepub fn max_bytes(self) -> u32
pub fn max_bytes(self) -> u32
Returns the wire value: 0 when disabled, otherwise the UTF-8 byte cap.
Sourcepub fn from_max_bytes(value: u32) -> Self
pub fn from_max_bytes(value: u32) -> Self
Decodes the wire value: 0 is off and any other value is the byte cap.
Trait Implementations§
Source§impl Clone for AssertMessageAnnotations
impl Clone for AssertMessageAnnotations
Source§fn clone(&self) -> AssertMessageAnnotations
fn clone(&self) -> AssertMessageAnnotations
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for AssertMessageAnnotations
Source§impl Debug for AssertMessageAnnotations
impl Debug for AssertMessageAnnotations
Source§impl Default for AssertMessageAnnotations
impl Default for AssertMessageAnnotations
Source§impl<'de> Deserialize<'de> for AssertMessageAnnotations
impl<'de> Deserialize<'de> for AssertMessageAnnotations
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AssertMessageAnnotations
Source§impl From<bool> for AssertMessageAnnotations
impl From<bool> for AssertMessageAnnotations
Source§impl PartialEq for AssertMessageAnnotations
impl PartialEq for AssertMessageAnnotations
Source§impl Serialize for AssertMessageAnnotations
impl Serialize for AssertMessageAnnotations
impl StructuralPartialEq for AssertMessageAnnotations
Auto Trait Implementations§
impl Freeze for AssertMessageAnnotations
impl RefUnwindSafe for AssertMessageAnnotations
impl Send for AssertMessageAnnotations
impl Sync for AssertMessageAnnotations
impl Unpin for AssertMessageAnnotations
impl UnsafeUnpin for AssertMessageAnnotations
impl UnwindSafe for AssertMessageAnnotations
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