pub struct PreparedProgram { /* private fields */ }Expand description
A [ProgramBlob] lowered to the buffers a ProgramSpec borrows.
ProgramSpec borrows its memory image and overlay list, so
something has to own them; that is this type. Build it once, then
hand out spec() as often as you like.
Implementations§
Source§impl PreparedProgram
impl PreparedProgram
Sourcepub fn new(
blob: &ProgramBlob,
endpoint: u8,
args: [u64; 4],
) -> Result<Self, PrepareError>
pub fn new( blob: &ProgramBlob, endpoint: u8, args: [u64; 4], ) -> Result<Self, PrepareError>
Prepare endpoint of blob for entry with args in φ[7..=10].
Mirrors the cap-path lowering exactly: the whole data extent is
materialized flat from DATA_BASE, the read-only region is
re-laid as an RoOverlay so guest stores fault, the register
file starts from the endpoint’s initial_regs (which the linker
seeded with the stack top), and declared_mem_size is the data
high-water mark that selects the load/store gas tier.
Sourcepub fn spec(&self) -> ProgramSpec<'_>
pub fn spec(&self) -> ProgramSpec<'_>
Borrow the prepared spec, ready for
run_program.
Auto Trait Implementations§
impl Freeze for PreparedProgram
impl RefUnwindSafe for PreparedProgram
impl Send for PreparedProgram
impl Sync for PreparedProgram
impl Unpin for PreparedProgram
impl UnsafeUnpin for PreparedProgram
impl UnwindSafe for PreparedProgram
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.