[−][src]Struct z80emu::host::TsCounter
A simple T-states counter wrapping at 2^bitsize of T. You may refer to it as a template for implementing Clock trait methods.
Methods from Deref<Target = Wrapping<T>>
Trait Implementations
impl<T> Clock for TsCounter<T> where
T: Copy + PartialEq + PartialOrd + From<u8> + From<u16>,
Wrapping<T>: AddAssign + Add<Output = Wrapping<T>>,
[src]
T: Copy + PartialEq + PartialOrd + From<u8> + From<u16>,
Wrapping<T>: AddAssign + Add<Output = Wrapping<T>>,
type Limit = T
This type is being used for an arbitrary representation of the limit
argument when executing
instructions. See Cpu::execute_with_limit for an explanation. Read more
type Timestamp = T
This type is being used for timestamping the interactions between Cpu, Io and Memory implementations. Read more
fn is_past_limit(&self, limit: Self::Limit) -> bool
[src]
Returns true
if self
as T
>= limit
. Otherwise returns false
.
fn add_irq(&mut self, _addr: u16) -> T
[src]
Returns self
after adding INT_IORQ_LOW_TS as T
.
Updates self
by adding IRQ_ACK_CYCLE_TS to the previous value of self
.
fn add_no_mreq(&mut self, _addr: u16, add_ts: NonZeroU8)
[src]
Updates self
by adding add_ts
T-states to the previous value of self
.
fn add_io(&mut self, _port: u16) -> T
[src]
Returns self
after adding IO_IORQ_LOW_TS as T
.
Updates self
by adding IO_CYCLE_TS to the previous value of self
.
fn add_mreq(&mut self, _addr: u16) -> T
[src]
Updates self
by adding MEMRW_CYCLE_TS to the previous value of self
.
Returns self
after updating as T
.
fn add_m1(&mut self, _addr: u16) -> T
[src]
Updates self
by adding M1_CYCLE_TS to the previous value of self
.
Returns self
after updating as T
.
fn add_wait_states(&mut self, _bus: u16, wait_states: NonZeroU16)
[src]
Updates self
by adding wait_states
T-states to the previous value of self
.
fn as_timestamp(&self) -> T
[src]
Returns a copy of self
as T
.
impl<T: Clone + Copy> Clone for TsCounter<T>
[src]
impl<T: Copy> Copy for TsCounter<T>
[src]
impl<T: Debug + Copy> Debug for TsCounter<T>
[src]
impl<T: Default + Copy> Default for TsCounter<T>
[src]
impl<T: Copy> Deref for TsCounter<T>
[src]
type Target = Wrapping<T>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl<T: Copy> DerefMut for TsCounter<T>
[src]
impl<'de, T: Copy> Deserialize<'de> for TsCounter<T> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T: Eq + Copy> Eq for TsCounter<T>
[src]
impl<T: Copy> From<T> for TsCounter<T>
[src]
impl<T: Copy> From<Wrapping<T>> for TsCounter<T>
[src]
impl<T: Ord + Copy> Ord for TsCounter<T>
[src]
fn cmp(&self, other: &TsCounter<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq + Copy> PartialEq<TsCounter<T>> for TsCounter<T>
[src]
impl<T: PartialOrd + Copy> PartialOrd<TsCounter<T>> for TsCounter<T>
[src]
fn partial_cmp(&self, other: &TsCounter<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &TsCounter<T>) -> bool
[src]
fn le(&self, other: &TsCounter<T>) -> bool
[src]
fn gt(&self, other: &TsCounter<T>) -> bool
[src]
fn ge(&self, other: &TsCounter<T>) -> bool
[src]
impl<T: Copy> Serialize for TsCounter<T> where
T: Serialize,
[src]
T: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<T: Copy> StructuralEq for TsCounter<T>
[src]
impl<T: Copy> StructuralPartialEq for TsCounter<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for TsCounter<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for TsCounter<T> where
T: Send,
T: Send,
impl<T> Sync for TsCounter<T> where
T: Sync,
T: Sync,
impl<T> Unpin for TsCounter<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for TsCounter<T> where
T: UnwindSafe,
T: UnwindSafe,
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<!> for 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>,