1 use crate::{ 2 AsContext, AsContextMut, GcRefImpl, Result, StructType, Val, 3 store::{StoreContextMut, StoreOpaque}, 4 }; 5 6 /// Support for `StructRefPre` disabled at compile time because the `gc` cargo 7 /// feature was not enabled. 8 pub enum StructRefPre {} 9 10 /// Support for `structref` disabled at compile time because the `gc` cargo feature 11 /// was not enabled. 12 pub enum StructRef {} 13 14 impl GcRefImpl for StructRef {} 15 16 impl StructRef { ty(&self, _store: impl AsContext) -> Result<StructType>17 pub fn ty(&self, _store: impl AsContext) -> Result<StructType> { 18 match *self {} 19 } 20 matches_ty(&self, _store: impl AsContext, _ty: &StructType) -> Result<bool>21 pub fn matches_ty(&self, _store: impl AsContext, _ty: &StructType) -> Result<bool> { 22 match *self {} 23 } 24 _matches_ty(&self, _store: &StoreOpaque, _ty: &StructType) -> Result<bool>25 pub(crate) fn _matches_ty(&self, _store: &StoreOpaque, _ty: &StructType) -> Result<bool> { 26 match *self {} 27 } 28 fields<'a, T: 'static>( &self, _store: impl Into<StoreContextMut<'a, T>>, ) -> Result<impl ExactSizeIterator<Item = Val> + 'a + '_>29 pub fn fields<'a, T: 'static>( 30 &self, 31 _store: impl Into<StoreContextMut<'a, T>>, 32 ) -> Result<impl ExactSizeIterator<Item = Val> + 'a + '_> { 33 match *self {} 34 Ok([].into_iter()) 35 } 36 field(&self, _store: impl AsContextMut, _index: usize) -> Result<Val>37 pub fn field(&self, _store: impl AsContextMut, _index: usize) -> Result<Val> { 38 match *self {} 39 } 40 set_field(&self, _store: impl AsContextMut, _index: usize, _value: Val) -> Result<()>41 pub fn set_field(&self, _store: impl AsContextMut, _index: usize, _value: Val) -> Result<()> { 42 match *self {} 43 } 44 } 45