[][src]Struct pir_8_emu::ReadWriteMarker

pub struct ReadWriteMarker { /* fields omitted */ }

Marker for wrapper types that need to track when they were read from/written to.

Examples

let marker = ReadWriteMarker::new();

assert_eq!(marker.was_read(), false);
assert_eq!(marker.was_written(), false);

marker.read();
assert_eq!(marker.was_read(), true);

let mut marker = marker;
marker.written();
assert_eq!(marker.was_written(), true);

marker.reset();
assert_eq!(marker.was_read(), false);
assert_eq!(marker.was_written(), false);

Methods

impl ReadWriteMarker[src]

pub fn new() -> ReadWriteMarker[src]

Create a new unread and unwritten marker.

pub fn read(&self)[src]

Mark this marker read.

pub fn written(&mut self)[src]

Mark this marker written.

pub fn was_read(self) -> bool[src]

Check if this marker was marked read.

pub fn was_written(self) -> bool[src]

Check if this marker was marked written.

pub fn reset(&mut self)[src]

Reset the marker to its original unread and unwritten state.

Trait Implementations

impl Clone for ReadWriteMarker[src]

impl Copy for ReadWriteMarker[src]

impl Debug for ReadWriteMarker[src]

impl Default for ReadWriteMarker[src]

impl Eq for ReadWriteMarker[src]

impl Hash for ReadWriteMarker[src]

impl Ord for ReadWriteMarker[src]

impl PartialEq<ReadWriteMarker> for ReadWriteMarker[src]

impl PartialOrd<ReadWriteMarker> for ReadWriteMarker[src]

impl StructuralEq for ReadWriteMarker[src]

impl StructuralPartialEq for ReadWriteMarker[src]

Auto Trait Implementations

impl RefUnwindSafe for ReadWriteMarker

impl !Send for ReadWriteMarker

impl !Sync for ReadWriteMarker

impl Unpin for ReadWriteMarker

impl UnwindSafe for ReadWriteMarker

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> Downcast for T where
    T: Any
[src]

impl<T> DowncastSync for T where
    T: Send + Sync + Any
[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, 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.