Skip to main content

Geometry

Struct Geometry 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn banks(&self, class: ObjectClass) -> Result<&[Bank]>

The banks a walk of class covers, in table order.

Source

pub fn allocation_unit(&self, class: ObjectClass) -> Result<AllocationUnit>

The unit class’s Status counters are denominated in.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.