[−][src]Enum checkers::Event
Metadata for a single allocation or deallocation.
Variants
Placeholder for empty events.
Allocation(Region)
An allocation.
Deallocation(Region)
A deallocation.
Methods
impl Event
[src]
pub fn is_allocation_with<F>(self, f: F) -> bool where
F: FnOnce(Region) -> bool,
[src]
F: FnOnce(Region) -> bool,
Test if this event is an allocation which matches the specified predicate.
Examples
let event = checkers::Event::Allocation(checkers::Region { ptr: 100.into(), size: 100, align: 4, }); assert!(event.is_allocation_with(|r| r.size == 100 && r.align == 4)); assert!(!event.is_deallocation_with(|r| r.size == 100 && r.align == 4));
pub fn is_deallocation_with<F>(self, f: F) -> bool where
F: FnOnce(Region) -> bool,
[src]
F: FnOnce(Region) -> bool,
Test if this event is a deallocation which matches the specified predicate.
Examples
let event = checkers::Event::Deallocation(checkers::Region { ptr: 100.into(), size: 100, align: 4, }); assert!(!event.is_allocation_with(|r| r.size == 100 && r.align == 4)); assert!(event.is_deallocation_with(|r| r.size == 100 && r.align == 4));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,