pub struct MicroCartridge { /* private fields */ }
Expand description

This struct represents an emulated Microdrive tape cartridge.

It consist of up to MAX_SECTORS Sectors. Instances of this struct can be “inserted” into one of 8 ZxMicrodrives’s emulator drives.

Implementations§

Returns the current drive’s head position counted in sectors as floating point value.

The fractional part indicates how far the head position is within a sector.

Returns the number of the emulated physical sectors on the tape.

Returns the number of formatted sectors.

Returns an iterator of formatted sectors with their original indices.

Returns true if the cartridge is write protected.

Changes the write protected flag of the cartridge.

Returns true if the given sector is formatted.

Panics

Panics if sector equals to or is above the max_sectors limit.

Creates a new instance of MicroCartridge with provided sectors.

Note

Content of the sectors is not verified and is assumed to be properly formatted.

Panics

The number of sectors provided must not be greater than MAX_USABLE_SECTORS. max_sectors must not be 0 and must be grater or equal to the number of provided sectors and must not be greater than MAX_SECTORS.

Creates a new instance of MicroCartridge with custom max_sectors number.

Panics

max_sectors must not be 0 and must not be greater than MAX_SECTORS.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more

Iterates through formatted sectors.

The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more

Iterates through formatted sectors.

The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
Returns file meta data if the file with file_name exists.
Returns a file type if the file with file_name exists.
Retrieves content of a binary file and writes it to a TAP chunk writer with a proper TAP header. Read more
Stores content read from a TAP chunk reader as a new file on a MicroCartridge. Returns the number of newly occupied sectors on success. Read more
Retrieves content of a file from a MicroCartridge and writes it to wr if the file with file_name exists. Returns the type and the size of the file on success. Read more
Stores content read from rd as a new file on a MicroCartridge. Returns the number of newly occupied sectors on success. Read more
Marks all sectors (including copies and unclosed files) belonging to a provided file_name as free. Returns the number of erased sectors. Read more
Returns an iterator of sector indices with unordered blocks of the provided file_name. Read more
Returns an iterator of sectors with ordered blocks belonging to the provided file_name. Read more
Validates formatted sectors and returns a catalog of files. Read more
Validates formatted sectors and returns a catalog name if all formatted sectors contain the same header indicating a properly formatted cartridge. Read more
Checks if each formatted sector has flags property set and if all checksums are valid.
Returns the number of sectors being used by file data.
Reads the content of an .mdr file into the MicroCartridge sectors. Read more
Writes all formatted sectors to an .mdr file using a provided writer. Read more
Creates a new instance of MicroCartridge with formatted sectors. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted. Read more
Causes self to use its LowerExp implementation when Debug-formatted. Read more
Causes self to use its LowerHex implementation when Debug-formatted. Read more
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted. Read more
Causes self to use its UpperExp implementation when Debug-formatted. Read more
Causes self to use its UpperHex implementation when Debug-formatted. Read more
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert to S a sample type from self.
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function. Read more
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref() only in debug builds, and is erased in release builds. Read more
Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref() only in debug builds, and is erased in release builds. Read more
Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.