pub struct Watchpoints(/* private fields */);
Expand description

Stores information about watchpoints and performs operations with them.

External users (that is, haybale users) probably don’t want to use this directly - instead, you’re probably looking for the watchpoint-related methods on State.

Implementations§

source§

impl Watchpoints

source

pub fn new() -> Self

Construct a new Watchpoints instance with no watchpoints.

To construct a new Watchpoints instance that contains some initial watchpoints, note that Watchpoints implements FromIterator<(String, Watchpoint)>, so you can for instance use collect() with an iterator over (watchpoint name, watchpoint) pairs.

source

pub fn add(&mut self, name: impl Into<String>, watchpoint: Watchpoint) -> bool

Add a memory watchpoint. It will be enabled unless/until disable() is called on it.

If a watchpoint with the same name was previously added, this will replace that watchpoint and return true. Otherwise, this will return false.

source

pub fn remove(&mut self, name: &str) -> bool

Remove the memory watchpoint with the given name.

Returns true if the operation was successful, or false if no watchpoint with that name was found.

source

pub fn disable(&mut self, name: &str) -> bool

Disable the memory watchpoint with the given name.

Returns true if the operation is successful, or false if no watchpoint with that name was found. Disabling an already-disabled watchpoint will have no effect and will return true.

source

pub fn enable(&mut self, name: &str) -> bool

Enable the memory watchpoint(s) with the given name.

Returns true if the operation is successful, or false if no watchpoint with that name was found. Enabling an already-enabled watchpoint will have no effect and will return true.

Trait Implementations§

source§

impl Clone for Watchpoints

source§

fn clone(&self) -> Watchpoints

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Watchpoints

source§

fn default() -> Watchpoints

Returns the “default value” for a type. Read more
source§

impl FromIterator<(String, Watchpoint)> for Watchpoints

source§

fn from_iter<I: IntoIterator<Item = (String, Watchpoint)>>(iter: I) -> Self

Creates a value from an iterator. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.