[−][src]Struct pir_8_emu::ReadWriteMarker
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]
fn clone(&self) -> ReadWriteMarker
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for ReadWriteMarker
[src]
impl Debug for ReadWriteMarker
[src]
impl Default for ReadWriteMarker
[src]
fn default() -> ReadWriteMarker
[src]
impl Eq for ReadWriteMarker
[src]
impl Hash for ReadWriteMarker
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for ReadWriteMarker
[src]
fn cmp(&self, other: &ReadWriteMarker) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<ReadWriteMarker> for ReadWriteMarker
[src]
fn eq(&self, other: &ReadWriteMarker) -> bool
[src]
fn ne(&self, other: &ReadWriteMarker) -> bool
[src]
impl PartialOrd<ReadWriteMarker> for ReadWriteMarker
[src]
fn partial_cmp(&self, other: &ReadWriteMarker) -> Option<Ordering>
[src]
fn lt(&self, other: &ReadWriteMarker) -> bool
[src]
fn le(&self, other: &ReadWriteMarker) -> bool
[src]
fn gt(&self, other: &ReadWriteMarker) -> bool
[src]
fn ge(&self, other: &ReadWriteMarker) -> bool
[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]
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> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
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>,