pub struct Data<Expr: Clone> { /* private fields */ }
Expand description
The initial contents of a memory are zero bytes. Data segments can be used to initialize a range of memory from a static vector of bytes.
The datas component of a module defines a vector of data segments.
Like element segments, data segments have a mode that identifies them as either passive or active. A passive data segment’s contents can be copied into a memory using the memory.init instruction. An active data segment copies its contents into a memory during instantiation, as specified by a memory index and a constant expression defining an offset into that memory.
Data segments are referenced through data indices.
Trait Implementations§
Source§impl From<Data<IgnoredExpr>> for IgnoredData
impl From<Data<IgnoredExpr>> for IgnoredData
Source§fn from(_value: Data<IgnoredExpr>) -> Self
fn from(_value: Data<IgnoredExpr>) -> Self
Converts to this type from the input type.
Source§impl<Expr: Debug + Clone + PartialEq> Section<CoreIndexSpace, CoreSectionType> for Data<Expr>
impl<Expr: Debug + Clone + PartialEq> Section<CoreIndexSpace, CoreSectionType> for Data<Expr>
fn index_space(&self) -> CoreIndexSpace
fn section_type(&self) -> CoreSectionType
Source§impl<T: Clone + RetainsInstructions> TryFrom<&Data<T>> for DataSection
impl<T: Clone + RetainsInstructions> TryFrom<&Data<T>> for DataSection
impl<Expr: Clone> StructuralPartialEq for Data<Expr>
Auto Trait Implementations§
impl<Expr> Freeze for Data<Expr>where
Expr: Freeze,
impl<Expr> RefUnwindSafe for Data<Expr>where
Expr: RefUnwindSafe,
impl<Expr> Send for Data<Expr>where
Expr: Send,
impl<Expr> Sync for Data<Expr>where
Expr: Sync,
impl<Expr> Unpin for Data<Expr>where
Expr: Unpin,
impl<Expr> UnwindSafe for Data<Expr>where
Expr: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more