pub struct ImageBuilder { /* private fields */ }Expand description
Canonical Image assembler. Callers supply logical content (code +
per-slot contiguous bytes + size, exactly as before the arena
redesign); build packs a single page-granular
arena deterministically: code laid contiguously at offset 0, then
each data cap (pinned then initial, in Key order) page-split with
all-zero pages elided and byte-identical pages deduplicated. The packing
is a pure function of the logical content, so equal logical Images
produce equal arenas and equal image_content_hashes regardless of
builder call order.
Implementations§
Source§impl ImageBuilder
impl ImageBuilder
pub fn new() -> Self
pub fn code(self, code: Vec<u8>) -> Self
pub fn endpoint(self, key: Key, ep: EndpointDef) -> Self
pub fn mapping(self, m: MemoryMapping) -> Self
pub fn pinned_data(self, key: Key, content: Vec<u8>, size: u64) -> Self
pub fn pinned_image(self, key: Key, content_hash: [u8; 32]) -> Self
pub fn initial_data(self, key: Key, content: Vec<u8>, size: u64) -> Self
pub fn yield_receiver_slot(self, slot: Option<Key>) -> Self
pub fn gas_slots(self, slots: Vec<Key>) -> Self
pub fn quota_slots(self, slots: Vec<Key>) -> Self
pub fn build(self) -> Image
Trait Implementations§
Source§impl Default for ImageBuilder
impl Default for ImageBuilder
Source§fn default() -> ImageBuilder
fn default() -> ImageBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ImageBuilder
impl RefUnwindSafe for ImageBuilder
impl Send for ImageBuilder
impl Sync for ImageBuilder
impl Unpin for ImageBuilder
impl UnsafeUnpin for ImageBuilder
impl UnwindSafe for ImageBuilder
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.