Skip to main content

VmIoEntry

Struct VmIoEntry 

Source
pub struct VmIoEntry {
    pub vm_space: Option<VmSpaceId>,
    pub kind: VmIoKind,
    pub vaddr: Vaddr,
    pub len: usize,
    pub owner: VmIoOwner,
}
Expand description

Per-VmIo entry in the store.

vm_space is None for VmIoOwners that have no parent VmSpace — kernel-space readers/writers from VmReader::from_kernel_space / VmWriter::from_kernel_space, and val_owners produced by read. Some(vs) for entries created by VmSpace::reader / writer.

View state is fully determined by vm_space + kind:

  • Some(_) (userspace, Fallible): mem_view: None, exactly as VmSpace::reader/writer ensure (vm_space.rs:323/382). Fallible methods are handle-only — no owner-side activation step exists or is needed.
  • None && Reader (kernel reader): read_view_initialized(), per VmReader<Infallible>::from_kernel_space ensures.
  • None && Writer (kernel writer or consumed_w val_owner from read): has_write_view(), per from_kernel_space / [io::read_step] ensures.

Fields§

§vm_space: Option<VmSpaceId>§kind: VmIoKind§vaddr: Vaddr§len: usize§owner: VmIoOwner

Implementations§

Source§

impl VmIoEntry

Source

pub open spec fn inv(self) -> bool

{
    &&& self.owner.inv()
    &&& match self.vm_space {
        Some(_) => self.owner.mem_view is None,
        None => {
            match self.kind {
                VmIoKind::Reader => self.owner.read_view_initialized(),
                VmIoKind::Writer => self.owner.has_write_view(),
            }
        }
    }

}

Per-entry invariant: derives view state from vm_space + kind.

Source

pub open spec fn is_kernel_reader(self) -> bool

{
    &&& self.vm_space is None
    &&& self.kind == VmIoKind::Reader

}

Operand-typing for the Infallible read/write ops. Exec VmReader::<Infallible>::read / VmWriter::<Infallible>::write are typed on kernel (Infallible) reader/writer handles; the embedding proxies “kernel/Infallible” with vm_space is None and reader-vs-writer with kind. These are not runtime preconditions — a userspace (Fallible) handle simply cannot be passed where the type system demands a kernel one — so they read as a well-formedness check on the operand, not a checkable obligation. (inv already gives read_view_initialized / has_write_view for these cases, exactly what vm_reader_read_embedded consumes.)

Source

pub open spec fn is_kernel_writer(self) -> bool

{
    &&& self.vm_space is None
    &&& self.kind == VmIoKind::Writer

}

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.

§

impl<T, VERUS_SPEC__A> FromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: From<T>,

§

fn obeys_from_spec() -> bool

§

fn from_spec(v: T) -> VERUS_SPEC__A

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.

§

impl<T, VERUS_SPEC__A> IntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: Into<T>,

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> T

§

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

§

fn obeys_into_spec() -> bool

§

fn into_spec(self) -> U

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, VERUS_SPEC__A> TryFromSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryFrom<T>,

§

fn obeys_try_from_spec() -> bool

§

fn try_from_spec( v: T, ) -> Result<VERUS_SPEC__A, <VERUS_SPEC__A as TryFrom<T>>::Error>

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.
§

impl<T, VERUS_SPEC__A> TryIntoSpec<T> for VERUS_SPEC__A
where VERUS_SPEC__A: TryInto<T>,

§

fn obeys_try_into_spec() -> bool

§

fn try_into_spec(self) -> Result<T, <VERUS_SPEC__A as TryInto<T>>::Error>

§

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

§

fn obeys_try_into_spec() -> bool

§

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

§

impl<A> SpecEq<&A> for A
where A: ?Sized,

§

impl<A> SpecEq<&mut A> for A
where A: ?Sized,

§

impl<A> SpecEq<A> for A
where A: ?Sized,

§

impl<A> SpecEq<Ghost<A>> for A

§

impl<A> SpecEq<Tracked<A>> for A