wasmtime/runtime/gc/disabled/
arrayref.rs

1use crate::runtime::vm::VMGcRef;
2use crate::{
3    store::{AutoAssertNoGc, StoreContextMut, StoreOpaque},
4    ArrayType, AsContext, AsContextMut, GcRefImpl, Result, Rooted, Val, I31,
5};
6
7/// Support for `ArrayRefPre` disabled at compile time because the `gc` cargo
8/// feature was not enabled.
9pub enum ArrayRefPre {}
10
11/// Support for `arrayref` disabled at compile time because the `gc` cargo feature
12/// was not enabled.
13pub enum ArrayRef {}
14
15impl GcRefImpl for ArrayRef {}
16
17impl ArrayRef {
18    pub(crate) fn from_cloned_gc_ref(
19        _store: &mut AutoAssertNoGc<'_>,
20        _gc_ref: VMGcRef,
21    ) -> Rooted<Self> {
22        unreachable!()
23    }
24
25    pub fn ty(&self, _store: impl AsContext) -> Result<ArrayType> {
26        match *self {}
27    }
28
29    pub fn matches_ty(&self, _store: impl AsContext, _ty: &ArrayType) -> Result<bool> {
30        match *self {}
31    }
32
33    pub(crate) fn _matches_ty(&self, _store: &StoreOpaque, _ty: &ArrayType) -> Result<bool> {
34        match *self {}
35    }
36
37    pub fn len(&self, _store: impl AsContext) -> Result<u32> {
38        match *self {}
39    }
40
41    pub fn elems<'a, T: 'a>(
42        &self,
43        _store: impl Into<StoreContextMut<'a, T>>,
44    ) -> Result<impl ExactSizeIterator<Item = Val> + 'a> {
45        match *self {}
46        Ok([].into_iter())
47    }
48
49    pub fn get(&self, _store: impl AsContextMut, _index: usize) -> Result<Val> {
50        match *self {}
51    }
52
53    pub fn set(&self, _store: impl AsContextMut, _index: usize, _value: Val) -> Result<()> {
54        match *self {}
55    }
56}