#[non_exhaustive]
pub enum ComputerModel {
Spectrum16,
Spectrum48,
SpectrumNTSC,
Spectrum128,
SpectrumPlus2,
SpectrumPlus2A,
SpectrumPlus3,
SpectrumPlus3e,
SpectrumSE,
TimexTC2048,
TimexTC2068,
TimexTS2068,
}
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Spectrum16
Spectrum48
SpectrumNTSC
Spectrum128
SpectrumPlus2
SpectrumPlus2A
SpectrumPlus3
SpectrumPlus3e
SpectrumSE
TimexTC2048
TimexTC2068
TimexTS2068
Implementations§
source§impl ComputerModel
impl ComputerModel
sourcepub fn frame_tstates(self) -> FTs
pub fn frame_tstates(self) -> FTs
Returns the number of T-states per single frame.
Examples found in repository?
src/z80/common.rs (line 240)
239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
pub fn z80_to_cycles(ts_lo: u16, ts_hi: u8, model: ComputerModel) -> FTs {
let total_ts = model.frame_tstates();
let qts = total_ts / 4;
let qcountdown = ts_lo as FTs;
(((ts_hi + 1) % 4 + 1) as FTs * qts - (qcountdown + 1))
.rem_euclid(total_ts)
}
pub fn cycles_to_z80(ts: FTs, model: ComputerModel) -> (u16, u8) {
let total_ts = model.frame_tstates();
let qts = total_ts / 4;
let ts_lo = (qts - (ts.rem_euclid(qts)) - 1) as u16;
let ts_hi = (ts.rem_euclid(total_ts) / qts - 1).rem_euclid(4) as u8;
(ts_lo, ts_hi)
}
sourcepub fn applicable_issue(self, issue: ReadEarMode) -> ReadEarMode
pub fn applicable_issue(self, issue: ReadEarMode) -> ReadEarMode
Returns issue
or ReadEarMode::Clear when it does not apply to the model.
Examples found in repository?
src/z80/loader.rs (lines 182-189)
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
pub fn load_z80<R: Read, S: SnapshotLoader>(
mut rd: R,
loader: &mut S
) -> Result<()>
{
use ComputerModel::*;
let header = Header::read_new_struct(rd.by_ref())?;
let mut version = Z80Version::V1;
let mut model = ComputerModel::Spectrum48;
let mut extensions = Extensions::default();
let mut cpu = create_cpu(&header)?;
let header_ex = if cpu.get_pc() == 0 {
let (ver, head_ex) = load_header_ex(rd.by_ref())?;
version = ver;
cpu.set_pc(u16::from_le_bytes(head_ex.pc));
let (mdl, ext) = select_hw_model(version, &head_ex).ok_or_else(||
io::Error::new(io::ErrorKind::InvalidData, "unsupported model")
)?;
model = mdl;
extensions = ext;
Some(head_ex)
}
else {
None
};
let flags1 = Flags1::from(header.flags1);
let border = flags1.border_color();
let flags2 = Flags2::from(header.flags2);
let joystick = flags2.joystick_model();
let issue = model.applicable_issue(
if flags2.is_issue2_emulation() {
ReadEarMode::Issue2
}
else {
ReadEarMode::Issue3
}
);
loader.select_model(model, extensions, border, issue)
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
loader.select_joystick(joystick);
loader.assign_cpu(CpuModel::NMOS(cpu));
// clippy false positive: https://github.com/rust-lang/rust-clippy/issues/9274
#[allow(clippy::read_zero_byte_vec)] {
let mut buf = Vec::new();
if version == Z80Version::V1 {
if flags1.is_mem_compressed() {
rd.read_to_end(&mut buf)?;
let buf = match buf.get(buf.len() - 4..) {
Some(MEMORY_V1_TERM) => &buf[..buf.len() - 4],
_ => &buf[..]
};
let decompress = MemDecompress::new(buf);
loader.read_into_memory(MemoryRange::Ram(0..3*PAGE_SIZE), decompress)?;
}
else {
loader.read_into_memory(MemoryRange::Ram(0..3*PAGE_SIZE), rd)?;
}
}
else {
while let Some((len, page, is_compressed)) = load_mem_header(rd.by_ref())? {
let range = mem_page_to_range(page, model, extensions).ok_or_else(||
io::Error::new(io::ErrorKind::InvalidData, "unsupported memory page")
)?;
if is_compressed {
buf.resize(len, 0);
rd.read_exact(&mut buf)?;
let decompress = MemDecompress::new(&buf);
loader.read_into_memory(range, decompress)?;
}
else {
loader.read_into_memory(range, rd.by_ref().take(len as u64))?;
}
}
}}
if let Some(head_ex) = header_ex {
if let Some(choice) = select_ay_model(model, Flags3::from(head_ex.flags3)) {
loader.setup_ay(choice, head_ex.ay_sel_reg.into(), &head_ex.ay_regs);
}
if version == Z80Version::V3 {
let ts = z80_to_cycles(u16::from_le_bytes(head_ex.ts_lo), head_ex.ts_hi, model);
loader.set_clock(ts);
let data = head_ex.port2;
if data != 0 {
match model {
SpectrumPlus2A|SpectrumPlus3|SpectrumPlus3e|
SpectrumSE => {
loader.write_port(0x1ffd, data);
}
_ => {}
}
}
}
match model {
TimexTC2048|TimexTS2068|TimexTC2068 => {
loader.write_port(0xf4, head_ex.port1);
}
Spectrum128|SpectrumPlus2|
SpectrumPlus2A|SpectrumPlus3|SpectrumPlus3e|
SpectrumSE => {
loader.write_port(0x7ffd, head_ex.port1);
}
_ => {}
}
match model {
TimexTC2048|TimexTS2068|TimexTC2068 => {
loader.write_port(0xff, head_ex.ifrom);
}
Spectrum16|Spectrum48|
Spectrum128|SpectrumPlus2|
SpectrumPlus2A|SpectrumPlus3|SpectrumPlus3e|
SpectrumSE
if head_ex.ifrom == 0xff && extensions.intersects(Extensions::IF1) => {
loader.interface1_rom_paged_in();
}
_ => {}
}
}
Ok(())
}
sourcepub fn validate_extensions(self, ext: Extensions) -> Result<(), Extensions>
pub fn validate_extensions(self, ext: Extensions) -> Result<(), Extensions>
Examples found in repository?
src/z80/saver.rs (line 357)
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
pub fn save_z80v1<C: SnapshotCreator, W: Write>(
snapshot: &C,
mut wr: W
) -> Result<SnapshotResult>
{
use ComputerModel::*;
let mut result = SnapshotResult::OK;
let model = snapshot.model();
match model {
Spectrum48 => {},
Spectrum16|SpectrumNTSC|TimexTC2048 => {
result.insert(SnapshotResult::MODEL_NSUP);
}
_ => return Err(io::Error::new(io::ErrorKind::InvalidInput,
"Z80: can't create a version 1 snapshot of this computer model"))
};
let extensions = snapshot.extensions();
if let Err(bad_ext) = model.validate_extensions(extensions) {
return Err(io::Error::new(io::ErrorKind::InvalidInput,
format!("Z80: the model {} can't be saved with {}", model, bad_ext)))
}
if extensions.intersects(Extensions::IF1) && snapshot.is_interface1_rom_paged_in()
|| extensions.intersects(Extensions::PLUS_D) && snapshot.is_plus_d_rom_paged_in()
|| extensions.intersects(Extensions::DISCIPLE) && snapshot.is_disciple_rom_paged_in()
|| extensions.intersects(Extensions::TR_DOS) && snapshot.is_tr_dos_rom_paged_in()
{
return Err(io::Error::new(io::ErrorKind::InvalidInput,
"Z80: can't create a version 1 snapshot with the external ROM paged in"))
}
if extensions != Extensions::NONE {
result.insert(SnapshotResult::EXTENSTION_NSUP);
}
let cpu = get_nmos_cpu(snapshot.cpu(), &mut result);
let border = snapshot.border_color();
let issue = snapshot.issue();
let joystick = snapshot.joystick();
if snapshot.ay_state(Ay3_891xDevice::Ay128k).is_some()
|| snapshot.ay_state(Ay3_891xDevice::Melodik).is_some()
|| snapshot.ay_state(Ay3_891xDevice::FullerBox).is_some()
|| snapshot.ay_state(Ay3_891xDevice::Timex).is_some()
{
result.insert(SnapshotResult::SOUND_CHIP_NSUP);
}
let mut header = Header::default();
init_z80_header(
&mut header,
Z80Version::V1,
&cpu,
border,
issue,
joystick,
&mut result
);
header.write_struct(wr.by_ref())?;
let is_16k = model == ComputerModel::Spectrum16;
let ramend = if is_16k { 0x4000 } else { 0xC000 };
let mem_slice = snapshot.memory_ref(MemoryRange::Ram(0..ramend))?;
compress_write_all(mem_slice, wr.by_ref())?;
if is_16k {
compress_repeat_write_all(!0, 0x8000, wr.by_ref())?;
}
wr.write_all(MEMORY_V1_TERM)?;
wr.flush()?;
Ok(result)
}
/// Saves a **Z80** file version 2 into `wr` from the provided reference to a `snapshot` struct
/// implementing [SnapshotCreator].
///
/// # Errors
/// This function may return an error from attempts to write the file or if for some reason
/// a snapshot could not be created.
pub fn save_z80v2<C: SnapshotCreator, W: Write>(
snapshot: &C,
wr: W
) -> Result<SnapshotResult>
{
let mut result = SnapshotResult::OK;
let model = snapshot.model();
let ext = snapshot.extensions();
let border = snapshot.border_color();
let issue = snapshot.issue();
let joystick = snapshot.joystick();
let cpu = get_nmos_cpu(snapshot.cpu(), &mut result);
if !is_cpu_safe_for_snapshot(&cpu) {
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Z80: can't safely snapshot the CPU state"))
}
if let Err(bad_ext) = model.validate_extensions(ext) {
return Err(io::Error::new(io::ErrorKind::InvalidInput,
format!("Z80: the model {} can't be saved with {}", model, bad_ext)))
}
let mut header = Header::default();
init_z80_header(
&mut header,
Z80Version::V2,
&cpu,
border,
issue,
joystick,
&mut result
);
let mut head_ex = HeaderEx::default();
init_z80_header_ex(
&mut head_ex,
cpu,
model,
ext,
snapshot,
select_hw_model_v2,
&mut result
)?;
save_all_v2v3(Z80Version::V2, snapshot, model, &header, &head_ex, wr)?;
Ok(result)
}
/// Saves a **Z80** file version 3 into `wr` from the provided reference to a `snapshot` struct
/// implementing [SnapshotCreator].
///
/// # Errors
/// This function may return an error from attempts to write the file or if for some reason
/// a snapshot could not be created.
pub fn save_z80v3<C: SnapshotCreator, W: Write>(
snapshot: &C,
wr: W
) -> Result<SnapshotResult>
{
use ComputerModel::*;
let mut result = SnapshotResult::OK;
let model = snapshot.model();
let ext = snapshot.extensions();
let border = snapshot.border_color();
let issue = snapshot.issue();
let joystick = snapshot.joystick();
let cpu = get_nmos_cpu(snapshot.cpu(), &mut result);
if !is_cpu_safe_for_snapshot(&cpu) {
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Z80: can't safely snapshot the CPU state"))
}
if let Err(bad_ext) = model.validate_extensions(ext) {
return Err(io::Error::new(io::ErrorKind::InvalidInput,
format!("Z80: the model {} can't be saved with {}", model, bad_ext)))
}
let mut header = Header::default();
init_z80_header(
&mut header,
Z80Version::V3,
&cpu,
border,
issue,
joystick,
&mut result
);
let mut head_ex = HeaderEx::default();
init_z80_header_ex(
&mut head_ex,
cpu,
model,
ext,
snapshot,
select_hw_model_v3,
&mut result
)?;
let (ts_lo, ts_hi) = cycles_to_z80(snapshot.current_clock(), model);
head_ex.ts_lo = ts_lo.to_le_bytes();
head_ex.ts_hi = ts_hi;
if (ext.intersects(Extensions::PLUS_D) && snapshot.is_plus_d_rom_paged_in())
|| (ext.intersects(Extensions::DISCIPLE) && snapshot.is_disciple_rom_paged_in())
{
head_ex.mgt_rom = !0;
}
if let Some(JoystickModel::Sinclair2) = joystick {
head_ex.joy_bindings = [ 3, 1, 3, 2, 3, 4, 3, 8, 3,10];
head_ex.joy_ascii = [31, 0,32, 0,33, 0,34, 0,35, 0];
}
match model {
SpectrumPlus2A|SpectrumPlus3|SpectrumPlus3e => {
head_ex.port2 = snapshot.ula3_flags().bits();
}
_ => {
head_ex.fn1 = !0;
if !(ext.intersects(Extensions::PLUS_D) && snapshot.is_plus_d_rom_paged_in()) {
head_ex.fn2 = !0;
}
}
}
if ext.intersects(Extensions::PLUS_D) {
head_ex.mgt_type = 16;
}
// head_ex.flags4 = 0;
// head_ex.disciple1 = 0;
// head_ex.disciple2 = 0;
save_all_v2v3(Z80Version::V3, snapshot, model, &header, &head_ex, wr)?;
Ok(result)
}
Trait Implementations§
source§impl Clone for ComputerModel
impl Clone for ComputerModel
source§fn clone(&self) -> ComputerModel
fn clone(&self) -> ComputerModel
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ComputerModel
impl Debug for ComputerModel
source§impl Display for ComputerModel
impl Display for ComputerModel
source§impl From<&ComputerModel> for &'static str
impl From<&ComputerModel> for &'static str
source§fn from(model: &ComputerModel) -> Self
fn from(model: &ComputerModel) -> Self
Converts to this type from the input type.
source§impl From<ComputerModel> for &str
impl From<ComputerModel> for &str
source§fn from(model: ComputerModel) -> Self
fn from(model: ComputerModel) -> Self
Converts to this type from the input type.
source§impl Hash for ComputerModel
impl Hash for ComputerModel
source§impl PartialEq<ComputerModel> for ComputerModel
impl PartialEq<ComputerModel> for ComputerModel
source§fn eq(&self, other: &ComputerModel) -> bool
fn eq(&self, other: &ComputerModel) -> bool
impl Copy for ComputerModel
impl Eq for ComputerModel
impl StructuralEq for ComputerModel
impl StructuralPartialEq for ComputerModel
Auto Trait Implementations§
impl RefUnwindSafe for ComputerModel
impl Send for ComputerModel
impl Sync for ComputerModel
impl Unpin for ComputerModel
impl UnwindSafe for ComputerModel
Blanket Implementations§
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
source§impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
source§fn into_sample(self) -> S
fn into_sample(self) -> S
Convert to
S
a sample type from self
.§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Immutable access to the
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Immutable access to the
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Mutable access to the
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds. Read more§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Calls
.tap_ref()
only in debug builds, and is erased in release
builds. Read more§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more