/// Define a table with an explicit initialization expression. /// /// Note that this is part of the function-references proposal. pubfn table_with_init(&mutself, table_type: TableType, init: &ConstExpr) -> &mutSelf { self.bytes.push(0x40); self.bytes.push(0x00);
table_type.encode(&mutself.bytes);
init.encode(&mutself.bytes); self.num_added += 1; self
}
}
/// A table's type. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pubstruct TableType { /// The table's element type. pub element_type: RefType, /// Whether or not this is a 64-bit table. pub table64: bool, /// Minimum size, in elements, of this table pub minimum: u64, /// Maximum size, in elements, of this table pub maximum: Option<u64>, /// Whether this table is shared or not. /// /// This is included the shared-everything-threads proposal. pub shared: bool,
}
impl TableType { /// Returns the type used to index this table. pubfn index_type(&self) -> ValType { ifself.table64 {
ValType::I64
} else {
ValType::I32
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.