pub(crate) struct Petr {Show 13 fields
activity: Activity,
direction: Direction,
tape_data: Vec<u8>,
tape_pos: usize,
data: Option<u8>,
already_warned_eof: bool,
read_failed: bool,
overrun: bool,
time_of_next_read: Option<Duration>,
connected_at_system_time: Option<Duration>,
connected_at_elapsed_time: Option<Duration>,
rewind_line_counter: usize,
mode: Unsigned12Bit,
}
Fields§
§activity: Activity
§direction: Direction
§tape_data: Vec<u8>
§tape_pos: usize
§data: Option<u8>
§already_warned_eof: bool
§read_failed: bool
§overrun: bool
§time_of_next_read: Option<Duration>
§connected_at_system_time: Option<Duration>
§connected_at_elapsed_time: Option<Duration>
§rewind_line_counter: usize
§mode: Unsigned12Bit
Implementations§
Source§impl Petr
impl Petr
pub(crate) fn new() -> Petr
fn next_poll_time(&mut self, system_time: &Duration) -> Duration
fn do_rewind(&mut self)
fn do_read(&mut self)
fn maybe_simulate_event(&mut self, system_time: &Duration)
fn transfer_mode(&self) -> TransferMode
Trait Implementations§
Source§impl Unit for Petr
impl Unit for Petr
Source§fn poll(&mut self, ctx: &Context) -> UnitStatus
fn poll(&mut self, ctx: &Context) -> UnitStatus
Query the status of the unit.
Source§fn transfer_mode(&self) -> TransferMode
fn transfer_mode(&self) -> TransferMode
Query the
TransferMode
of the unit.Source§fn read(
&mut self,
ctx: &Context,
_diagnostics: &CurrentInstructionDiagnostics,
) -> Result<MaskedWord, TransferFailed>
fn read( &mut self, ctx: &Context, _diagnostics: &CurrentInstructionDiagnostics, ) -> Result<MaskedWord, TransferFailed>
Handle a TSD on an input channel.
Source§fn write(
&mut self,
_ctx: &Context,
_source: Unsigned36Bit,
diagnostics: &CurrentInstructionDiagnostics,
) -> Result<Option<OutputEvent>, TransferFailed>
fn write( &mut self, _ctx: &Context, _source: Unsigned36Bit, diagnostics: &CurrentInstructionDiagnostics, ) -> Result<Option<OutputEvent>, TransferFailed>
Handle a TSD on an output channel.
Source§fn disconnect(&mut self, _ctx: &Context)
fn disconnect(&mut self, _ctx: &Context)
Disconnect the unit.
Source§fn on_input_event(
&mut self,
_ctx: &Context,
event: InputEvent,
) -> Result<InputFlagRaised, InputEventError>
fn on_input_event( &mut self, _ctx: &Context, event: InputEvent, ) -> Result<InputFlagRaised, InputEventError>
Announce an input event for a unit.
Auto Trait Implementations§
impl Freeze for Petr
impl RefUnwindSafe for Petr
impl Send for Petr
impl Sync for Petr
impl Unpin for Petr
impl UnwindSafe for Petr
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.