[][src]Enum checkers::Violation

pub enum Violation {
    ConflictingAlloc {
        requested: Region,
        existing: Region,
    },
    NonZeroedAlloc {
        requested: Region,
    },
    NonCopiedRealloc {
        free: Region,
        alloc: Region,
    },
    MisalignedAlloc {
        requested: Region,
    },
    IncompleteFree {
        requested: Region,
        existing: Region,
    },
    MisalignedFree {
        requested: Region,
        existing: Region,
    },
    MissingFree {
        requested: Region,
    },
    Leaked {
        region: Region,
    },
}

Variants

ConflictingAlloc

Fields of ConflictingAlloc

requested: Regionexisting: Region
NonZeroedAlloc

Fields of NonZeroedAlloc

requested: Region
NonCopiedRealloc

Fields of NonCopiedRealloc

free: Regionalloc: Region
MisalignedAlloc

Fields of MisalignedAlloc

requested: Region
IncompleteFree

Fields of IncompleteFree

requested: Regionexisting: Region
MisalignedFree

Fields of MisalignedFree

requested: Regionexisting: Region
MissingFree

Fields of MissingFree

requested: Region
Leaked

Fields of Leaked

region: Region

Methods

impl Violation[src]

pub fn is_leaked_with<F>(&self, f: F) -> bool where
    F: FnOnce(Region) -> bool
[src]

Test that this violation refers to a dangling region and that it matches the given predicate.

Examples

let violation = Violation::Leaked {
    region: Region::new(42.into(), 20, 4),
};
assert!(violation.is_leaked_with(|r| r.size == 20 && r.align == 4));

let requested = Region::new(10.into(), 10, 1);
let violation = Violation::MisalignedAlloc { requested };
assert!(!violation.is_leaked_with(|r| true));

Trait Implementations

impl Clone for Violation[src]

impl Debug for Violation[src]

impl Display for Violation[src]

impl Eq for Violation[src]

impl PartialEq<Violation> for Violation[src]

impl StructuralEq for Violation[src]

impl StructuralPartialEq for Violation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.