pub struct Geometry { /* private fields */ }Expand description
What the instrument says it holds: every partition, and each one’s banks.
The partition index is the object class code, so this answers “does this instrument
have that class, how many banks does it have, and how large are they” without any
constant. The two (Native) partitions are carried and never consulted — they are a
second view of a library this crate addresses through its user partition.
Implementations§
Source§impl Geometry
impl Geometry
Sourcepub async fn read<T: Transport, C>(
session: &mut Session<'_, T, C>,
) -> Result<Self>
pub async fn read<T: Transport, C>( session: &mut Session<'_, T, C>, ) -> Result<Self>
Read both tables: PARTITIONS, then BANKS for each partition’s index in table
order.
A refused BANKS fails the whole read, as its Error::DeviceStatus: geometry
missing a partition bounds no walk and sizes no write, and there is nothing to
gain by carrying the hole to whichever caller trips over it.
Sourcepub fn entries(&self) -> impl Iterator<Item = (&Partition, &[Bank])>
pub fn entries(&self) -> impl Iterator<Item = (&Partition, &[Bank])>
Every partition in table order with its banks. This is the whole table,
(Native) partitions included, rather than the classes this crate names.
Sourcepub fn partition(&self, class: ObjectClass) -> Result<&Partition>
pub fn partition(&self, class: ObjectClass) -> Result<&Partition>
The partition storing class. An instrument without one is an error, never a
default: the whole point of reading the table is not to assume.
Sourcepub fn banks(&self, class: ObjectClass) -> Result<&[Bank]>
pub fn banks(&self, class: ObjectClass) -> Result<&[Bank]>
The banks a walk of class covers, in table order.
Sourcepub fn allocation_unit(&self, class: ObjectClass) -> Result<AllocationUnit>
pub fn allocation_unit(&self, class: ObjectClass) -> Result<AllocationUnit>
The unit class’s Status counters are denominated in.
Sourcepub fn check_address(
&self,
class: ObjectClass,
at: Location,
) -> Result<Option<String>>
pub fn check_address( &self, class: ObjectClass, at: Location, ) -> Result<Option<String>>
Whether an address exists on this instrument, from the tables already read.
op::check_address is the same question asked of a fresh BANKS read; this is
the one to use where the geometry is in hand, because it costs no frame.